-
Notifications
You must be signed in to change notification settings - Fork 179
Define the large code model #254
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
Conversation
30f3d92 to
564b95a
Compare
|
|
||
| ```assembly | ||
| auipc s0, %pcrel_hi(__global_pointer__) | ||
| addi s0, s0, %pcrel_lo(__global_pointer__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work if you have more then 2G-4G of code in the object
|
|
||
| ### Program Linkage Table | ||
|
|
||
| Each PLT entry follows the pattern below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the linker know which you want?
| jr t3 | ||
| nop | ||
| 2: | ||
| .quad .got.plt - ., 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This either forbids lazy binding or requires RWX PLT entries at run time, not just load time (though even load time is not great); the latter is something that is strongly discouraged and has been deliberately moved away from on most architectures
|
|
||
| | Source | Assembly | Relocations | ||
| | -- | -- | -- | ||
| | `extern int src;` | `.extern src` | `R_RISCV_64` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No they're not, declarations generate no code
|
From a linker author's perspective, we want to turn a PLT-indirect reference to a direct reference if a referenced symbol is within reach. Does this spec allow such relaxation? |
|
Prefer #388, so close this PR |
This is a working draft.