[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU binutils




On Mon, 13 Apr 1998, Guido Flohr wrote:

> Hi!
> 
> I've had a close look at the current binutils for Atari.  The latest
> version I found was in an archive named "util38s.zoo", is that 
> correct?

Nope. Christian Felsch, who did the port of 2.7.2.3 also modified them.
You can find the sources here:

ftp://ftp.rz.tu-harburg.de/pub/software/systems/atari/gnu/source/util-40s.lzh


> I've done some minor changes:
> 
> - The nm command is now 99% compatible to the latest nm in the GNU
>   binutils (2.6.1); that means that you can give it long options,
>   you can choose between three different output formats (BSD,
>   SYS V and POSIX), display values in hexadecimal, decimal
>   and octal.
> 
> - nm now also recognizes weak and indirect symbols.
> 
> - I haven't implemented the "--line-number" and "--sort-by-size"
>   options because this would require some effort and the sources
>   for the binutils are in a terrible state.
> 
> - I've never really understood why some versions of ld look
>   for `foobar.olb' and some for `libfoobar.a' when you pass
>   it the option `-lfoobar'.  I've changed this to the standard
>   behavior, i.e. the default is `libfoobar.a'.  Any problems
>   with that?

You may take a look at the documenation of the 2.7.2.3 port, how the
corresponding utillities handle that.

> - A critical modification:  I need weak symbols although I
>   haven't really understood what this means. ;-)
>   As far as I can see it, weak symbols work like this:  The
>   MiNTLib defines the functions tzset(), localtime() and
>   gmtime() in one single module (localtim.o).  If one of your object 
>   modules reference any one symbol defined in localtim.o the
>   entire module gets loaded.  If you want to replace for
>   example only "localtime()" you have to provide your own
>   version of all other externally visible symbols in that
>   module, too.  Otherwise the linker will complain about
>   multiple definitions of "localtime()".
>   
>   Weak symbols seemingly avoid this.  I can do something like
>   this:
>   
>   	struct tm* my_localtime (t)
>   	  const time_t* t;
>   	{
>   	  /* My code here... */
>   	}
>   	__asm__ (".weak _localtime");
>   	__asm__ ("_localtime = _my_localtime");
>   
>   Now I can safely link that module with the MiNTLib.  The linker
>   should accept the symbol name "_localtime" as an alias for
>   "_my_localtime"; it won't complain about the other definition
>   of "_localtime" in the library.  The GNU libc uses this mechanism to 
>   override some definitions in the standard system libc.

Do you know any good documents about that subject?

> The other problem I have is sym-ld.  I don't have a working
> debugger environment and I would have to incorporate the 
> patches for weak symbols blindly.  Would anybody test
> that for me?  I can provide the sources for a library with
> loads of weak symbols.

One feature of the utils40 you should integrate is the automatic creation
of the symbol file when `-g' is given.
I don't think, that weak symbols cause any troubles with the last port of
gdb (3.xx). But I'm willing to prove me wrong :o)

> 
> Thanks for your comments!
> 
> Guido
> -- 
> http://stud.uni-sb.de/~gufl0000
> mailto:gufl0000@stud.uni-sb.de
>