-
Notifications
You must be signed in to change notification settings - Fork 211
[aaelf64] Clarify relocation optimization [issue #328] #352
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1427,9 +1427,8 @@ Linkers may optionally optimize instructions affected by relocation. Relocation | |
| - The relocations apply to consecutive instructions in the order specified. | ||
| - The relocations use the same symbol. | ||
| - The relocated instructions have the same source and destination register. | ||
| - The relocations do not appear separately or in a different order. | ||
|
|
||
| In this case each set of relocations is independent and may be optimized. The following sequences are defined: | ||
| The following sequences are defined: | ||
|
|
||
| - Large GOT indirection | ||
|
|
||
|
|
@@ -1452,8 +1451,9 @@ Linkers may optionally optimize instructions affected by relocation. Relocation | |
| - ``symbol`` does not have a ``st_shndx`` of ``SHN_ABS`` or the output is not required to be position independent. | ||
| - ``symbol`` is within range of the ``R_<CLS>_ADR_PREL_PG_HI21`` relocation. | ||
| - The addend of both relocations is zero. | ||
| - All ``R_<CLS>_ADR_GOT_PAGE`` and ``R_<CLS>_LD64_GOT_LO12_NC`` relocations to ``symbol`` are part of a sequence. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be combined with the line below and removed from the specific conditions. For example If the Examples that prevent the Large GOT indirection optimization for :: A linker may avoid creating a GOT entry if no other GOT relocations exist for the symbol. |
||
|
|
||
| The optimized sequence does not require a GOT entry. A linker may avoid creating a GOT entry if no other GOT relocations exist for the symbol. | ||
| If the GOT relocations are used outside of a valid sequence, the optimization is not legal (for that symbol). The optimized sequence does not require a GOT entry. A linker may avoid creating a GOT entry if no other GOT relocations exist for the symbol. | ||
|
|
||
| - PC-relative addressing | ||
|
|
||
|
|
@@ -1469,6 +1469,8 @@ Linkers may optionally optimize instructions affected by relocation. Relocation | |
| NOP | ||
| ADR x0, symbol // R_<CLS>_ADR_PREL_LO21 | ||
|
|
||
| Each sequence is independent and may be optimized if in range. | ||
|
|
||
| Proxy-generating relocations | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
|
||
|
|
||
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.
Line 1425 above (can't put the comment on the line). I suggest we insert a "base" before conditions
"if all the following base conditions are true."