-
Notifications
You must be signed in to change notification settings - Fork 165
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
Define relocations for ULEB128 value: R_RISCV_SET_ULEB128 and R_RISCV_SUB_ULEB128 #361
Conversation
Update the link of LLVM + LLD patch. |
Define. Suggest: just specify the full names of the two new relocation types. |
e6a905c
to
333012a
Compare
333012a
to
02f4770
Compare
Update:
|
02f4770
to
caddcb2
Compare
Changes:
|
LGTM, it have been expected to support this feature for a long time :) |
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.
Overall looking good.
caddcb2
to
bf3e94b
Compare
bf3e94b
to
8f1ad93
Compare
…_SUB_ULEB128 ULEB128 has used in DWARF and exception handling table, it used to record value, or record the distance between two symbols. The later one would be an issue for debug info and exception handling table, since the symbol address might updated during, then the value might incorrect after relaxation, some of those field has alternative encoding type, but some new field defined in DWARF 5 ins't provide alternative format other than ULEB128, e.g. DW_RLE_offset_pair, DW_RLE_startx_length, DW_RLE_startx_endx and DW_RLE_start_length. This PR basically same as #162, but updated to the trunk, and also document ULEB128 should not shrink the size of the data, since we never know the data used in where and does the length has recorded in somewhere or not, so this would be most safe way. binutils patch: https://sourceware.org/pipermail/binutils/2020-January/109672.html
8f1ad93
to
96d6e19
Compare
Thanks everyone! gonna merge this! |
.2+| 60 .2+| SET_ULEB128 .2+| Static | _ULEB128_ .2+| Local label assignment <<uleb128-note,*note>> | ||
<| S + A | ||
.2+| 61 .2+| SUB_ULEB128 .2+| Static | _ULEB128_ .2+| Local label subtraction <<uleb128-note,*note>> | ||
<| V - S + A |
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.
Actually I think this needs to be V - S - A
for consistency with other SUB 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.
Good catch! it actually should be V - (S + A)
but V -S - A
would be consistency with others.
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.
hot-fix applied: 4f7de69
ULEB128 has used in DWARF and exception handling table, it used to record value, or record the distance between two symbols.
The later one would be an issue for debug info and exception handling table, since the symbol address might updated during, then the value might incorrect after relaxation, some of those field has alternative encoding type, but some new field defined in DWARF 5 ins't provide alternative format other than ULEB128, e.g. DW_RLE_offset_pair, DW_RLE_startx_length, DW_RLE_startx_endx and DW_RLE_start_length.
This PR basically same as #162, but updated to the trunk, and also document ULEB128 should not shrink the size of the data, since we never know the data used in where and does the length has recorded in somewhere or not, so this would be most safe way.
binutils patch: https://sourceware.org/pipermail/binutils/2020-January/109672.html
LLVM patch: https://reviews.llvm.org/D142879
LLD patch: https://reviews.llvm.org/D142880