-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ld: can't relax section: Success #205
Comments
Can you guys reproduce this? Is anyone working on it? Is there anything I can do to help? After updating to e3e50c5 (and changing the I'm currently not updating riscv-gnu-toolchain for PicoRV32 because of this problem. |
@palmer-dabbelt Do any of your recent relocation fixes impact this test? |
I'll look into it |
The problem manifests because the text section lost word alignment. Currently, .align on text sections only does the right thing if the text section is already 4-byte aligned (or 2-byte aligned for RVC). You can work around this by putting the string in the data section. Working on a fix... |
Previously, the alignment directives were not correctly supported in the text section when current alignment was only 1 byte (i.e., when the address was odd). Since there are no 1-byte instructions in RISC-V, this patch resolves the bug by writing a zero byte to obtain 2-byte alignment, at which point a 2-byte NOP can be used to obtain 4-byte alignment. Resolves riscv-collab/riscv-gnu-toolchain#205
Should be fixed in riscv-binutils-gdb. Re-running test suite, then we can push to riscv-gnu-toolchain. |
Previously, the alignment directives were not correctly supported in the text section when current alignment was only 1 byte (i.e., when the address was odd). Since there are no 1-byte instructions in RISC-V, this patch resolves the bug by writing a zero byte to obtain 2-byte alignment, at which point a 2-byte NOP can be used to obtain 4-byte alignment. Resolves riscv-collab/riscv-gnu-toolchain#205
Previously, the alignment directives were not correctly supported in the text section when current alignment was only 1 byte (i.e., when the address was odd). Since there are no 1-byte instructions in RISC-V, this patch resolves the bug by writing a zero byte to obtain 2-byte alignment, at which point a 2-byte NOP can be used to obtain 4-byte alignment. Resolves riscv-collab/riscv-gnu-toolchain#205 gas/ChangeLog 2016-12-16 Andrew Waterman <andrew@sifive.com> * config/tc-riscv.c (riscv_make_nops): Emit 2-byte NOPs. * config/tc-riscv.c (riscv_frag_align_code): New variable min_text_alignment_order, to pass to frag_align_code.
Previously, the alignment directives were not correctly supported in the text section when current alignment was only 1 byte (i.e., when the address was odd). Since there are no 1-byte instructions in RISC-V, this patch resolves the bug by writing a zero byte to obtain 2-byte alignment, at which point a 2-byte NOP can be used to obtain 4-byte alignment. Resolves riscv-collab/riscv-gnu-toolchain#205 gas/ChangeLog 2016-12-16 Andrew Waterman <andrew@sifive.com> * config/tc-riscv.c (riscv_make_nops): Emit 2-byte NOPs. * config/tc-riscv.c (riscv_frag_align_code): New variable min_text_alignment_order, to pass to frag_align_code.
Previously, the alignment directives were not correctly supported in the text section when current alignment was only 1 byte (i.e., when the address was odd). Since there are no 1-byte instructions in RISC-V, this patch resolves the bug by writing a zero byte to obtain 2-byte alignment, at which point a 2-byte NOP can be used to obtain 4-byte alignment. Resolves riscv-collab/riscv-gnu-toolchain#205 * config/tc-riscv.c (riscv_make_nops): Emit 2-byte NOPs. (riscv_frag_align_code): Correct frag_align_code arg.
Previously, the alignment directives were not correctly supported in the text section when current alignment was only 1 byte (i.e., when the address was odd). Since there are no 1-byte instructions in RISC-V, this patch resolves the bug by writing a zero byte to obtain 2-byte alignment, at which point a 2-byte NOP can be used to obtain 4-byte alignment. Resolves riscv-collab/riscv-gnu-toolchain#205 gas/ChangeLog 2016-12-16 Andrew Waterman <andrew@sifive.com> * config/tc-riscv.c (riscv_make_nops): Emit 2-byte NOPs. * config/tc-riscv.c (riscv_frag_align_code): New variable min_text_alignment_order, to pass to frag_align_code.
I've derived the following test case from the
gcc -E
output forauipc.S
from riscv-tests:With 805ee1d (built with --with-arch=RV32I) I get the following error:
The test case is minimal in the sense that commenting out any of the three instructions, the .ascii statement, or the .align statement makes the problem disappear.
The text was updated successfully, but these errors were encountered: