https://sourceware.org/bugzilla/show_bug.cgi?id=9934

--- Comment #23 from Alan Modra <amodra at gmail dot com> ---
Created attachment 17228
  --> https://sourceware.org/bugzilla/attachment.cgi?id=17228&action=edit
possible way to support relocs with no symtab

Provide a symtab with one all-zero symbol for object files that have
relocations but no .symtab or an empty .symtab.  Such object files are
not ELF gABI compliant, which reads

In chapter 4, under Relocation heading:
"A relocation section references two other sections: a symbol table
and a section to modify. The section header's sh_info and sh_link
members, described in Sections above, specify these relationships."

In chapter 4, under Symbol Table heading:
"The symbol table entry for index 0 (STN_UNDEF) is reserved; it holds
the following."

Taken together I believe this says any file with relocations must have
a symbol table which must have an entry for STN_UNDEF.  However, a
long time ago GNU binutils strip/objcopy could remove the symbol table
in object files that had relocations but only against STN_UNDEF.  See
pr9945.

I don't intend to apply this patch, just putting it here if we ever do have a
good reason to support these odd files.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to