This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Linkerscript: fix VA value assigned to sections when using constraints.
ClosedPublic

Authored by grimar on Aug 12 2016, 8:55 AM.

Details

Summary

Previously we searched output section by name to assign VA. That did not
work in the case when multiple output sections with different constraints were defined in script.
Testcase shows the possible issue scenario, patch fixes the issue.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar updated this revision to Diff 67841.Aug 12 2016, 8:55 AM
grimar retitled this revision from to [ELF] - Linkerscript: fix VA value assigned to sections when using constraints..
grimar updated this object.
grimar added a reviewer: ruiu.
grimar added subscribers: llvm-commits, grimar, davide, evgeny777.
ruiu added inline comments.Aug 12 2016, 11:15 AM
ELF/LinkerScript.cpp
333 ↗(On Diff #67841)

This function has duplicate code with matchConstraints. Can you reorganize this and that to reduce the amount of code?

grimar updated this revision to Diff 67894.Aug 12 2016, 1:34 PM
  • Addressed review comment.
ELF/LinkerScript.cpp
333 ↗(On Diff #67841)

Done.

grimar updated this revision to Diff 67901.Aug 12 2016, 1:38 PM
  • Simplified.
ruiu accepted this revision.Aug 12 2016, 1:42 PM
ruiu edited edge metadata.

LGTM

ELF/LinkerScript.cpp
218–219 ↗(On Diff #67901)

Instead of template this function, use uint64_t instead of ELF::uint.

This revision is now accepted and ready to land.Aug 12 2016, 1:42 PM
This revision was automatically updated to reflect the committed changes.