linker operation sequence issue

Jan Beulich
Mon Nov 20 11:19:00 GMT 2006

lang_process() calls lang_place_orphans() before ldemul_before_allocation(),
however the latter is where .eh_frame_hdr gets marked SEC_EXCLUDE if
unused, hence the section is considered orphan and, depending on whether
elf32 or generic/genelf is being used this then in the latter case results (after
the pending adjustment of making .eh_frame_hdr generation independent
of the use of dynamic linking) is the section not getting assigned to a
segment at all.

Question: Is this odd/inverted dependency intentional? If not, is there
anything I can do about this, given that I'm not really an expert of the linker
code? Or, if yes to the first question, would it be reasonable to copy the
place_orphan logic from elf32.em to genelf.em? Or should I rather detect
the NULL place_orphan member and not create .eh_frame_hdr in that case
at all (since other related code also wouldn't be properly called)?

Thanks, Jan

More information about the Binutils mailing list