Relocation against discarded sections
Jan Kratochvil
jan.kratochvil@redhat.com
Wed Dec 17 20:50:00 GMT 2008
More information about the Binutils mailing list
Wed Dec 17 20:50:00 GMT 2008
- Previous message (by thread): Relocation against discarded sections
- Next message (by thread): Relocation against discarded sections
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 17 Dec 2008 21:16:17 +0100, Evandro Menezes wrote:
> There's code to handle relocations against symbols in discarded sections in
> elflink.c. But firstly why do they happen at all?
Some sections may get discarded - for example inlined functions of C++ classes
"classA.h":
class A
{
public:
A (int a) { f (); };
};
A::A() needs to be defined only once but such function is present in each .o
file. Therefore during linking only one such instance is left and other
instances are discarded.
This is being currently done through COMDAT groups, it were .gnu.linkonce.*
sections before.
And some sections can be referencing these link-once sections, such as
.eh_frame containing exceptions unwinding information for these inlined
functions. If the function itself is removed the entries for it in the
.eh_frame section are no longer needed. Therefore these entries must be
safely nullified by removing the relocations _to_ the discarded section.
If anyone (Alan Modra?) would be so kind to approve my last version of:
Re: [patch] Restore .gnu.linkonce.r. g++-3.4 linking
http://sourceware.org/ml/binutils/2008-11/msg00195.html
followup on: http://sourceware.org/ml/binutils/2008-10/threads.html#00200
Thanks,
Jan
- Previous message (by thread): Relocation against discarded sections
- Next message (by thread): Relocation against discarded sections
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Binutils mailing list