delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/08/08/14:23:05

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Authenticated: #10658336
Mime-Version: 1.0 (Apple Message framework v618)
In-Reply-To: <2nn50lF2gp65U1@uni-berlin.de>
References: <E94D7E69-E940-11D8-9F0B-003065C18A1C AT gmx DOT ch> <2nn50lF2gp65U1 AT uni-berlin DOT de>
Message-Id: <E1C88213-E967-11D8-889C-003065C18A1C@gmx.ch>
From: =?ISO-8859-1?Q?Werner_Sch=F6nenberger?= <werner DOT schoenenberger AT gmx DOT ch>
Subject: Re: Sequence of Symbol Allocation
Date: Sun, 8 Aug 2004 20:22:18 +0200
To: djgpp AT delorie DOT com
X-Mailer: Apple Mail (2.618)
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019