This is an archive of the discontinued LLVM Phabricator instance.

Handle .eh_frame pointing to discarded section in -r
ClosedPublic

Authored by rafael on Feb 14 2017, 2:49 PM.

Details

Reviewers
pcc

Diff Detail

Event Timeline

rafael created this revision.Feb 14 2017, 2:49 PM
pcc edited edge metadata.Feb 14 2017, 3:20 PM

Unfortunately this isn't enough to fix the Go bindings tests, it causes the final link to fail with a different error:

bin/ld.lld: error: /tmp/lit_tmp_Sxmw_u/go-link-243494992/000000.o:(.eh_frame): FDE doesn't reference another section

You can reproduce it with your test case like this:

$ ra/bin/ld.lld ra/tools/lld/test/ELF/Output/relocatable-eh-frame.s.tmp
ra/bin/ld.lld: error: ra/tools/lld/test/ELF/Output/relocatable-eh-frame.s.tmp:(.eh_frame): FDE doesn't reference another section

or just pass in the _all.o from the reproducer I posted earlier.

Perhaps the simplest thing to do would be to relax the FDE checking during regular links? That doesn't sound very appealing though.

pcc accepted this revision.Feb 14 2017, 3:36 PM

This does seem reasonable on its own though if we wanted to go the route of stripping FDEs without function relocations during regular links. If we did that we could accept object files produced using "ld.gold -r" as well.

This revision is now accepted and ready to land.Feb 14 2017, 3:36 PM
espindola closed this revision.Mar 14 2018, 4:18 PM
espindola added a subscriber: espindola.

295133