[Top][All Lists]

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

[Bug ld/6478] stab warnings cause linker errors

From: amodra at bigpond dot net dot au
Subject: [Bug ld/6478] stab warnings cause linker errors
Date: 15 Aug 2008 10:22:47 -0000

------- Additional Comments From amodra at bigpond dot net dot au  2008-08-15 
10:22 -------
This comment in front of generic_link_read_symbols explains why we are running
into trouble:

/* Grab the symbols for an object file when doing a generic link.  We
   store the symbols in the outsymbols field.  We need to keep them
   around for the entire link to ensure that we only read them once.
   If we read them multiple times, we might wind up with relocs and
   the hash table pointing to different instances of the symbol
   structure.  */

The ELF backend does not cache symbols it reads from input files to outsymbols.
 So ldmain.c:warning_callback reads symbols and relocs from a-elf.o via the ELF
backend code, and caches the relocs.  Later,
linker.c:default_indirect_link_order calls generic_link_read_symbols and gets a
different set of symbol pointers which are used to resolve symbol values.  Then
the generic linker tries to relocate a-elf.o .text section, but the ELF backend
returns the cached relocs which are using the wrong set of symbols.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

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