This is the mail archive of the binutils@sources.redhat.com 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]

Re:RFC: ELF prelinker - 0.1.1


Jakub, you wrote :- 

> Still unfinished in this area is relocating of Dwarf/Dwarf-2 (but
> Stabs are already done) - the debugging formats are tricky because
> they don't have corresponding .rel* sections in shared libraries, so
> one has to understand the format and see what values need to be
> adjusted and what not.

But I don't believe that you should be relocating either Stabs or
DWARF. 

For things in dynamic libraries the stabs/dwarf addresses should be
those of the unrelocated library (i.e. offsets from the address at
whic hthe library is loaded). It's up to the debugger to add in the
appropriate base address when it knows where the library actually got
loaded in a specific process.

Consider that in the normal course of events the dynamic linker cannot
possibly relocate stabs/dwarf because these sections are not loaded in
to store.

I believe that if you relocate the stabs/dwarf then things will fail
because debuggers will _also_ relocate them (using the information
they get from the dynamic linker's list of "struct link_map" items),
and the result will be that the base offset of the dynamic library
will be added in _twice_.

-- Jim 

James Cownie	<jcownie@etnus.com>
Etnus, LLC.     +44 117 9071438
http://www.etnus.com


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