mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-27 04:52:05 +08:00
551703cfd4
bfd/ * elfnn-riscv.c (riscv_resolve_pcrel_lo_relocs): Add check for reloc overflow with addend. Use reloc_dangerous instead of reloc_overflow. Add strings for the two errors handled here. (riscv_elf_relocate_section) In case R_RISCV_PCREL_LO12_I, rewrite comment. Only give error with addend when used with section symbol. In case bfd_reloc_dangerous, update error string. ld/ * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run pcrel-lo-addend-2. * testsuite/ld-riscv/elf/ld-riscv-elf/pcrel-lo-addend-2.d: New. * testsuite/ld-riscv/elf/ld-riscv-elf/pcrel-lo-addend-2.s: New. * testsuite/ld-riscv/elf/ld-riscv-elf/pcrel-lo-addend.d: Update name and error string.
17 lines
198 B
ArmAsm
17 lines
198 B
ArmAsm
.text
|
|
.globl _start
|
|
.align 3
|
|
_start:
|
|
nop
|
|
.LA0: auipc a5,%pcrel_hi(ll)
|
|
lw a0,%pcrel_lo(.LA0)(a5)
|
|
lw a0,%pcrel_lo(.LA0+4)(a5)
|
|
ret
|
|
.globl ll
|
|
.data
|
|
.align 3
|
|
.zero 2024
|
|
ll:
|
|
.word 0
|
|
.word 0
|