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

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
340

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
340

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

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.