[Bug gold/28098] R_*_NONE entries in rela.eh_frame cause an empty eh_frame_hdr section

Michael Krasnyk michael.krasnyk@gmail.com
Sun Jul 18 06:10:40 GMT 2021


Hi,

please consider a patch that fixes generation empty .eh_frame_hdr sections
linking with libraries that have R_*_NONE relocation entries with zero
r_sym in rela.eh_frame sections.

Result values of Reloc::advance are used at five places
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/ehframe.cc;h=8a19b21055924ae17c40f9f7c2ac4e421bf58392;hb=HEAD#l665
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/ehframe.cc;h=8a19b21055924ae17c40f9f7c2ac4e421bf58392;hb=HEAD#l688
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/ehframe.cc;h=8a19b21055924ae17c40f9f7c2ac4e421bf58392;hb=HEAD#l889
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/ehframe.cc;h=8a19b21055924ae17c40f9f7c2ac4e421bf58392;hb=HEAD#l922
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/ehframe.cc;h=8a19b21055924ae17c40f9f7c2ac4e421bf58392;hb=HEAD#l1018

 for early termination of do_add_ehframe_input_section and at one place
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gold/ehframe.cc;h=8a19b21055924ae17c40f9f7c2ac4e421bf58392;hb=HEAD#l919
in an assertion, so this change should not change behavior but prevent
earlier termination if the relocation section has an entry with r_info = 0.

Related issue https://sourceware.org/bugzilla/show_bug.cgi?id=28098

Kind regards,
Michael Krasnyk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-GOLD-PR28098-Skip-R_-_NONE-relocation-entries-with-z.patch
Type: text/x-patch
Size: 1764 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20210718/59548b50/attachment.bin>


More information about the Binutils mailing list