This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gc-sections and DWARF ranges


On Fri, Oct 22, 2010 at 11:22:57AM -0700, Cary Coutant wrote:
> With gold, we don't observe the problem because it takes a pair of
> zeroes to terminate the list, and gold still applies the addend when
> applying a relocation that refers to a discarded symbol. In the
> .debug_ranges section, for a function foo, we'll see relocations for
> foo and foo+n. Where gnu ld relocates this to a (0,0) pair, gold
> produces a (0,n) pair. Arguably, this isn't an ideal thing to do
> either, but at least gdb doesn't get confused by the (0,n) entry.

GNU ld used to do this (pre-2006).  We deliberately switched over to
the 0,0 version.  0,n is fine for bogus .debug_ranges lists, but bad
for architectures with low valid addresses; I routinely used to get
discarded functions from 0x0 to 0x14000 when valid code started around
0x100.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]