Mail Archives: djgpp/2004/08/08/14:23:05
Hi Hans-Bernhard,
first of all, thank you very much for your reply.
> I object to these being called "progamming techniques". Their correct
> name is "bloody hacks". And like all bloody hacks, they will come
> back to haunt you one day. Looks like for your particular project,
> that day has come.
I completely agree with you - it seems that I have to eat the soup on
the hard way :-(
> The source of your problem is given right there in "info gas symbols":
>
> _Warning:_ `as' does not place symbols in the object file in the
> same order they were declared. This may break some debuggers.
This sounds that there is no chance to bring the symbol to the same
order as declared. This would mean that I have to check the complete
code for any of these "bloody hacks". This will keep me busy for the
next months.
> Expecting .comm symbols, of all things, to remain ordered, strikes me
> as begging for problems. By their very nature, common symbols will be
> gone over and reorganized by the linker. If you don't want that,
> use structs to hold them in, i.e. in C parlance, instead of
>
> /* globals */
> int a;
> unsigned long b;
> char c;
>
> do
>
> /* global struct */
> struct {
> int a;
> unsigned long b;
> char c;
> } struct_of_globals;
This is a good idea but since the most part of the code is in
assembler, there is no chance for structures. But nevertheless thank
you for the hint - perhaps there might be a way for relocation of the
symbols in the initializing phase. I have to check this out.
<snip>
> I suggest you take this on to the real authors of the software you're
> dealing with: the GNU binutils people. DJGPP is just a port of these
> programs to DOS, but this issue is quite independent of that.
> Actually I'ld venture a guess you'll see exactly the same behaviour if
> you build your original code using GNU binutils on Sun boxes.
Thank you for this hint too.
Best regards
Werner
- Raw text -