-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LLD silently misinterprets the LMA in linkerscripts #163
Comments
Note, because bugzilla is unresponsive:
|
I've commented on the PR, my reading from LLVM-DEV was that there wasn't consensus on using github issues yet. My interpretation of the version is that this is on lld-10. I think that this may have been fixed on master with https://reviews.llvm.org/D74297 |
Yes, lld 10 built on the 28th of February from commit
Interesting, I guess this patch didn't land in time before the LLVM-10 branch was created. |
Fixed by https://reviews.llvm.org/D74297
There are still differences: ld.lld does not create the empty PT_LOAD, but it should not matter. If
There should not be a different at runtime, but lld's p_offset fields save space. |
Can/Will this be backported to LLVM-10? |
For reference, the PR is https://bugs.llvm.org/show_bug.cgi?id=45078
It's probably too late for 10.0.0, but it may be a candidate for 10.0.1. |
This caught my attention as I was looking at the ObjWriter. LLVM no longer emits a `LC_VERSION_MIN_MACOSX` load command unless we explicitly set a version. I don't see a difference in `llvm-objdump -macho -x foo.o` with/without these lines (I didn't bother myself to boot into macOS to run `otool`).
Summary: This fixes issue llvm#163, among other improvements to go-to-definition. Reviewers: sammccall Subscribers: jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69237
Downstream issue: ziglang/zig#4595
Corresponding Bugzilla Issue
Content from downstream issue reproduced here (courtesy of @LemonBoy):
ASM file:
Linker script:
Linked using the following command line:
ld.lld-10 -T /tmp/script.ld /tmp/foo.o -o /tmp/foo
Version:
1:10~++20200228052623+4c6e5899859-1~exp1~20200228163220.107
(from the LLVM's APT repo)The problem lies in how the physical address of the program headers is calculated, the value computed by
lld
is wildly wrong:On the other hand
gnu ld
produces the correct result:btw thanks for allowing GitHub issues. It's much nicer than bugzilla
The text was updated successfully, but these errors were encountered: