This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Linkerscript: support hidden symbols assignments
ClosedPublic

Authored by phosek on Aug 15 2016, 4:33 PM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

phosek updated this revision to Diff 68109.Aug 15 2016, 4:33 PM
phosek retitled this revision from to [ELF] Linkerscript: support hidden symbols assignments.
phosek updated this object.
phosek added reviewers: ruiu, rafael.
phosek added a project: lld.
phosek added a subscriber: llvm-commits.
phosek added a comment.EditedAug 15 2016, 4:35 PM

Just for reference, HIDDEN command is supported by both GNU linker and as of recently gold as well.

ruiu added inline comments.Aug 15 2016, 4:38 PM
ELF/LinkerScript.cpp
970 ↗(On Diff #68109)

I'd change this function readProvideHidden(bool Provide, bool Hidden) and then

973–974 ↗(On Diff #68109)

do

Cmd->Provide = Provide;
Cmd->Hidden = Hidden;
985–994 ↗(On Diff #68109)

so that I can do

} else if (Tok == "PROVIDE"))
  Cmd = readProvideHidden(true, false);
} else if (Tok == "HIDDEN")) {
  Cmd = readProvideHidden(false, true);
} else if (Tok == "PROVIDE_HIDDEN")) {
  Cmd = readProvideHidden(true, true);
}
phosek updated this revision to Diff 68119.Aug 15 2016, 5:59 PM
phosek marked 3 inline comments as done.
ruiu accepted this revision.Aug 15 2016, 6:11 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Aug 15 2016, 6:11 PM
This revision was automatically updated to reflect the committed changes.