This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Support FLAGS attribute in PHDR definition
ClosedPublic

Authored by evgeny777 on Jul 20 2016, 3:56 AM.

Details

Reviewers
ruiu
Summary

Allows user to specify flags for each program header

Diff Detail

Event Timeline

evgeny777 updated this revision to Diff 64656.Jul 20 2016, 3:56 AM
evgeny777 retitled this revision from to [ELF] Support FLAGS attribute in PHDR definition.
evgeny777 updated this object.
evgeny777 added a reviewer: ruiu.
evgeny777 set the repository for this revision to rL LLVM.
evgeny777 added a project: lld.
evgeny777 added subscribers: grimar, ikudrin, llvm-commits.
ruiu added inline comments.Jul 20 2016, 7:04 AM
ELF/LinkerScript.cpp
662

Set Flags to PF_R by default. Then you should be able to remove HasFlags member.

evgeny777 added inline comments.Jul 20 2016, 7:11 AM
ELF/LinkerScript.cpp
662

I have small concern about such change. Currently if we don't set PHDR flags in script then flags are OR-combined from member section flags. If we set flags in script then I guess we can't change them while assigning sections to segment, can we?

ruiu added inline comments.Jul 20 2016, 7:25 AM
ELF/LinkerScript.cpp
662

I see. Then how about setting to -1 if a flag is absent?

evgeny777 updated this revision to Diff 64836.Jul 21 2016, 1:34 AM
evgeny777 removed rL LLVM as the repository for this revision.

Review updated

ruiu accepted this revision.Jul 21 2016, 3:41 AM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 21 2016, 3:41 AM
evgeny777 closed this revision.Jul 21 2016, 5:25 AM
grimar added inline comments.Jul 21 2016, 9:07 AM
ELF/LinkerScript.cpp
384

Is this correct ?

evgeny777 added inline comments.Jul 21 2016, 9:11 AM
ELF/LinkerScript.cpp
384

That's definitely a bug. Thanks, George!

grimar added inline comments.Jul 21 2016, 9:12 AM
ELF/LinkerScript.cpp
384

Please update testcase to catch this then.