This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Fix error reporting for eh_frame and other synthetic sections
ClosedPublic

Authored by evgeny777 on Mar 13 2017, 5:53 AM.

Details

Summary

Such sections don't belong to any specific file, so getLocation<ELFT>() will crash for them. One of possible cases is
out of range relocation in .eh_frame section

Diff Detail

Repository
rL LLVM

Event Timeline

evgeny777 created this revision.Mar 13 2017, 5:53 AM

Looks testcase can be simplified a bit.

test/ELF/linkerscript/eh-frame-reloc-out-of-range.s
6 ↗(On Diff #91544)

Do you need PHDRS for this testcase ?

8 ↗(On Diff #91544)

Do you need to place .eh_frame_hdr explicitly ?

ruiu accepted this revision.Mar 13 2017, 1:20 PM

LGTM

This revision is now accepted and ready to land.Mar 13 2017, 1:20 PM
evgeny777 added inline comments.Mar 14 2017, 1:07 AM
test/ELF/linkerscript/eh-frame-reloc-out-of-range.s
6 ↗(On Diff #91544)

By default "A" (eh_frame and eh_frame_hdr) and "AX" (text) sections go to the same segment. If you remove PHDRS you'll get very large (> 60GB) output file.

This revision was automatically updated to reflect the committed changes.