Page MenuHomePhabricator

[ELF] Use the Repl point to avoid the segfault when using ICF
ClosedPublic

Authored by phosek on Sep 17 2018, 6:01 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

phosek created this revision.Sep 17 2018, 6:01 PM

I haven't managed to come up with a minimal reproducer yet, but this addresses the issue when using the reproducer attached in https://bugs.llvm.org/show_bug.cgi?id=38918.

phosek updated this revision to Diff 165891.Sep 17 2018, 8:01 PM

Now also includes a reproducer.

So after looking a bit more into the output of the reproducer, I realized this is not the correct solution because it leads to relocations being duplicated. Instead, relocations for the folded section shouldn't be emitted at all so this's a deeper rooted issue.

The test will need to verify that the emitted relocs are correct too.

ruiu added inline comments.Sep 18 2018, 3:48 AM
lld/test/ELF/icf18.s
1 ↗(On Diff #165891)

This is not an assembly although the file extension is .s. Can you write this in assembly?

phosek updated this revision to Diff 166207.Sep 19 2018, 6:01 PM
phosek marked an inline comment as done.
phosek updated this revision to Diff 166218.Sep 19 2018, 8:54 PM
phosek updated this revision to Diff 166341.Sep 20 2018, 11:49 AM
ruiu accepted this revision.Sep 20 2018, 3:43 PM

LGTM

This revision is now accepted and ready to land.Sep 20 2018, 3:43 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.