This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: vtable pseudo ops
Bo Thorsen <bo@sonofthor.dk> writes:
> My current problem is that I'm unsure of how to write the vtable
> relocations. I don't know how to get the symbols written in the object
> file so they can be picked up by the linker.
As Alan said, you can use the pseudo-ops directly.
In the compiler, use the -fvtable-gc option.
> And a small thing: What should the name of the sections be? I'm currently
> using .vte and .vti but this does not say as much of the contents as
> .vtable.entry and .vtable.inherit or .vtable_e and .vtable_i.
I suggest that the section names start with ``.gnu.''.
> One last question: Does the ability to write these special sections belong
> in libbfd so objcopy and others can benefit from them?
As far I can see, you shouldn't need any special support in objcopy
for these sections. As far as I can see, you shouldn't need to add
anything to libbfd which is specific to these sections, other than the
linker support.
You may want to add some code to elf.c to dump these sections when
objdump -p is used.
Ian