Comments (3)
Thanks for the suggestion and the motivating details. If I've understood this correctly this is a data relocation, that generates a GOT entry, and resolves to the 32-bit pc-relative offset to that GOT entry. The GOT entry may point to an entity that isn't DSO local so this may require a dynamic relocation.
I think the expression we use for that for the equivalent instruction relocations is G(GDAT(S+A))- P
GDAT(S+A) generates the GOT entry and the dynamic relocation R__GLOB_DAT(S+A).
G(GDAT(S+A)) is the address of that GOT entry
G(GDAT(S+A)) - P is the offset to the GOT entry.
I note that no linker currently implements the GDAT(S+A) correctly, I think LLD would implement as G(GDAT(S)) - P + A and GNU ld would ignore the addend A (#217) that is probably best handled by issue 217 so I suggest we keep the expression consistent.
I think this would result in:
GOT-relative data relocation
...
315 | - | R_<CLS>_GOTREL32 | G(GDAT(S+A))- P | Write bits [31:0] of X at byte-aligned place P. This represents a 32-bit offset relative to GOT, treated as signed; Check that -2^31 <= X < 2^31 |
I think the fastest way to progress this would be to submit a pull request with the suggested changes. Otherwise it is waiting for someone to write it up.
To me (as an individual) the proposal looks reasonable. I'm wondering if it is worth defining a 64-bit R__GOTREL64 while we are here. My instinct is that we wait till something needs it.
from abi-aa.
Thanks for the suggestion and the motivating details. If I've understood this correctly this is a data relocation, that generates a GOT entry, and resolves to the 32-bit pc-relative offset to that GOT entry. The GOT entry may point to an entity that isn't DSO local so this may require a dynamic relocation.
Correct
I think the expression we use for that for the equivalent instruction relocations is G(GDAT(S+A))- P GDAT(S+A) generates the GOT entry and the dynamic relocation R__GLOB_DAT(S+A). G(GDAT(S+A)) is the address of that GOT entry G(GDAT(S+A)) - P is the offset to the GOT entry.
Oh ok that makes sense. I actually didn't notice GDAT(S+A)
before but that equation works also.
I note that no linker currently implements the GDAT(S+A) correctly, I think LLD would implement as G(GDAT(S)) - P + A and GNU ld would ignore the addend A (#217) that is probably best handled by issue 217 so I suggest we keep the expression consistent.
I think this would result in:
GOT-relative data relocation ... 315 | - | R_<CLS>_GOTREL32 | G(GDAT(S+A))- P | Write bits [31:0] of X at byte-aligned place P. This represents a 32-bit offset relative to GOT, treated as signed; Check that -2^31 <= X < 2^31 |
I think the fastest way to progress this would be to submit a pull request with the suggested changes. Otherwise it is waiting for someone to write it up.
Can do. Wanted some early feedback to see if there would be any hard no's.
To me (as an individual) the proposal looks reasonable. I'm wondering if it is worth defining a 64-bit R__GOTREL64 while we are here. My instinct is that we wait till something needs it.
I'm also in the boat of reserving it until it's needed.
from abi-aa.
Submitted #223
from abi-aa.
Related Issues (20)
- [sysvabi64] document requirement for bti c in more detail HOT 1
- [aaelf64] BTI PLT requirement should be weaker HOT 2
- Is page-size part of the ABI ? HOT 1
- [sysvabi64] Optional `add x16, x16, :lo12: &.got.plt[N]]` for `ld -z now` HOT 5
- Clarify definition of HFA in AAPCS64 HOT 8
- RST code blocks of type "none" cause warnings when generating html
- Word wrap in RST source files is inconsistent
- PAuthABI support for DWARF (Debugging and Unwinding)
- Reserve DT_ tags used in the PAuthABI and MemtagABI.
- static linkers (lld and GNU ld) out of sync with aaelf64 for GOT relocations with addends. HOT 1
- Need dynamic tag to reflect .note.gnu.prop and/or .note.AARCH64-PAUTH-ABI-tag section addresses HOT 3
- Undefined weak symbol's address HOT 8
- Missing page "Semihosting for AArch32 and AArch64" HOT 4
- [pauthabielf64] Define `NT_ARM_TYPE_PAUTH_ABI_TAG` constant
- Some documents have stopped rendering in the preview mode in the Github UI HOT 3
- aaelf64/aaelf64.rst can't preview HOT 2
- Clarify use of DWARF versions
- Quantifying the benefits of DT_AARCH64_AUTH_RELR HOT 5
- [PAUTHABIELF64] Possible typo in `R_AARCH64_AUTH_GOT_LO12_NC` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abi-aa.