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
liblink, cmd/ld: don't encode the instruction being relocated in Reloc.add #10050
Milestone
Comments
I don't know how seriously my input should be taken here, but this whole game confused the heck out of me when I did arm64 external linking. Passing the original value to archreloc would make a lot more sense. |
Yeah, I'm trying to add R_ADDRARM64, and I really can't bear the current
scheme anymore.
It's just too much unnecessary work (and ADRP encodes the immediate value
in two parts
make everything even more annoying.)
|
FWIW, this threw me for a while today. |
Too late for Go 1.5. |
mwhudson
added a commit
to mwhudson/go
that referenced
this issue
Aug 3, 2015
And clean up the mess on arm64 (the mess on arm is too confusing). See issue golang#10050 Change-Id: I2ce813fe8646d4e818eb660612a7e4b2bb04de4c
mwhudson
added a commit
to mwhudson/go
that referenced
this issue
Aug 3, 2015
And clean up the mess on arm64 (the mess on arm is too confusing). See issue golang#10050 Change-Id: I2ce813fe8646d4e818eb660612a7e4b2bb04de4c
CL https://golang.org/cl/13884 mentions this issue. |
mwhudson
added a commit
to mwhudson/go
that referenced
this issue
Aug 27, 2015
And clean up the mess on arm64 (the mess on arm is too confusing). See issue golang#10050 Change-Id: I2ce813fe8646d4e818eb660612a7e4b2bb04de4c
ianlancetaylor
pushed a commit
that referenced
this issue
Aug 31, 2015
And clean up the mess on arm64 (the mess on arm is too confusing). See issue #10050 Change-Id: I2ce813fe8646d4e818eb660612a7e4b2bb04de4c Reviewed-on: https://go-review.googlesource.com/13884 Reviewed-by: Ian Lance Taylor <iant@golang.org>
mwhudson
added a commit
to mwhudson/go
that referenced
this issue
Sep 2, 2015
And clean up the mess on arm64 (the mess on arm is too confusing). See issue golang#10050 Change-Id: I2ce813fe8646d4e818eb660612a7e4b2bb04de4c
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I first implemented cgo for ARM, I made the wrong precedence to encode
the instruction itself in the relocation's addend field. It makes everything harder:
liblink must stuff the real addend into the instruction, put it in reloc.add, and then
in the linker, it must get the real addend out from the instruction, calculate the
real value, and stuff the value back into the instruction.
Additionally, it makes -S output unreadable.
(Note: the 2nd line is calling into the middle of duffzero, but you can't tell
anything from the addend without some shifts and masks to figure out the
offset)
Compare this to the 6g -S output:
I suspect this is because in cmd/ld/lib.c, we always pass a zero val (the variable o)
to archreloc, instead, it really should pass the original value read from the symbol.
Should we correct this? so that archreloc is passed the real instrutions/data being
relocated in *val argument, and we place the real addend in Reloc.add field?
The text was updated successfully, but these errors were encountered: