[llvm-bugs] [Bug 46110] Specifying -Ttext <altaddr> leaves data loaded at default text load address

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 1 23:40:03 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46110

Fangrui Song <i at maskray.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |i at maskray.me
         Resolution|---                         |INVALID

--- Comment #2 from Fangrui Song <i at maskray.me> ---
Many people use -Ttext=$base to specify the image base. This works for GNU ld
with -z noseparate-code but not with -z separate-code.

LLD has defaulted to a R/RX/RW/RW layout for a long time (unless
--no-rosegment). -Ttext can only change the address of a section named ".text"
in the RX segment (often referred to as the "text segment"). For the reason of
mismatching expectation, I wrote "-Ttext=$base (base is usually 0) is no longer
supported. If PT_PHDR is needed, use --image-base=$base instead."

I agree that the -Ttext= is probably less useful than -Ttext-segment= and the
latter is usually what people should use. The functionality of -Ttext= is still
available, so I don't see a strong reason removing it (it can lead to confusion
- but removing it will also cause feature requests "support -Ttext=" => I think
we have to accept the status quo).

> I have built Valgrind successfully with lld versions 10 and 11 by using the --image-base=$base.

Thanks for doing that. If possible, please upstream the patch to the upstream.
Feel free to CC me if needed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200602/a86ce1ca/attachment.html>


More information about the llvm-bugs mailing list