gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] BFD linking -


From: Camm Maguire
Subject: Re: [Gcl-devel] BFD linking -
Date: 19 Oct 2002 00:03:03 -0400

Hi Mike!  Please accept my apologies for not giving more attention to
this lately. 

"Mike Thomas" <address@hidden> writes:

> Hi all.
> 
> In "o/sfasli.c" there is a function "build_symbol_table_bfd()" which builds
> a symbol table from an executable image."
> 
> As it steps through the symbols it finds those which contain the string
> "@@GLIBC" and applies a function "bfd_link_hash_lookup()".  There are three
> questions I have:
> 
> 1.  The BFD doc doesn't describe "bfd_link_hash_lookup()".  Does someone
> know what it does?
> 

Curious, I thought I found the doc somewhere.  In any case, it looks
up, or optionally adds, symbols into a hash table associated with the
bfd.  When a new object is opened, each of its symbols are hashed
against this table to get the symbols address in the running image.
This address is then set in the symbol's relocation in the module
code. 


> 2. What is the significance of the string "@@GLIBC"?
> 

For reasons as yet unknown to me, glibc added this string to certain
function symbols, e.g. setjmp, in the final image but not in as yet
unlinked modules.  The idea behind this code is to add a hash entry
for the symbol name without the @@GLIBC to match against the format in
the modules.

> 3. Why are those symbols being singled out?
> 

See above.


> On Windows that string does not appear in executables.  Instead, symbols
> typically look like:
> 
> 00562ba0 B __stacktop
> 00000003 A __subsystem__
> 00544a20 T __Unwind_Find_FDE
> 00545870 T __vsnprintf
> 005454e0 T _abort
> 005438e0 T address@hidden
> 00544570 t _add_fdes
> 0042e50e T _add_int_big
> 0040ac06 T _add_page_to_freelist
> 

If the string is not there, the code should do nothing, so I think
this should square fine on Windows.

> I have checked a test program into CVS called "bfdtest.c" to assist with BFD
> debugging.
> 

Great!  I'll try to take a look as time allows.  I still have on my
list a checkin of the lib you wanted, together with a reply to the gdb
dump you posted on your bfd segfault.  Will try to get to it soon.

Take care,

> Cheers
> 
> Mike Thomas
> 
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]