This is an archive of the discontinued LLVM Phabricator instance.

ELF: Don't examine values of linker script symbols during ICF.
ClosedPublic

Authored by pcc on Aug 28 2018, 12:43 PM.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

pcc created this revision.Aug 28 2018, 12:43 PM
grimar accepted this revision.Aug 29 2018, 1:13 AM

LGTM. Minor nits/suggestions.

lld/ELF/Symbols.h
119 ↗(On Diff #162935)

I think this should be added after the NeedsTocRestore below. Because this group of flags is
not initialized in the constructor.

lld/test/ELF/linkerscript/Inputs/icf.script
2 ↗(On Diff #162935)

I would avoid adding the input and just used echo "foo = 1; bar = 1" > %t.script instead,

This revision is now accepted and ready to land.Aug 29 2018, 1:13 AM
ruiu accepted this revision.Aug 29 2018, 1:20 AM

LGTM

lld/ELF/ICF.cpp
255 ↗(On Diff #162935)

Please add a comment saying that linker-script-generated placeholder symbols look the same at this moment but they would have different values later.

This revision was automatically updated to reflect the committed changes.
pcc marked 3 inline comments as done.