[PATCH] D27613: [ELF] - Change now -Ttext/-Tdata/-Tbss works.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 9 04:00:22 PST 2016


grimar created this revision.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.

Previously user was unable to set -Ttext=0x0 for example,
it is PR31295. Result was a crash because of wrong calculation of file offsets offsets.
bfd sets the section address in that case, gold the segment address.

Patch implements bfd behavior, it places sections specified by -T* to be first in the load.
That way we can start assinging addresses from their VA and do not intersect with other sections.
Testcase shows what I mean.


https://reviews.llvm.org/D27613

Files:
  ELF/Driver.cpp
  ELF/Writer.cpp
  test/ELF/ttext-tdata-tbss.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27613.80876.patch
Type: text/x-patch
Size: 5045 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161209/96d64d4b/attachment.bin>


More information about the llvm-commits mailing list