mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-18 23:03:29 +08:00
2a0d985349
bfd/ * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous when pcrel_lo reloc has an addend. Use reloc_dangerous callback for bfd_reloc_dangerous. Use einfo instead of warning callback for errors. Add %X%P to error messages. ld/ * testsuite/ld-riscv-elf/ld-riscv-elf.exp: Run pcrel-lo-addend test. * testsuite/ld-riscv-elf/pcrel-lo-addend.d: New. * testsuite/ld-riscv-elf/pcrel-lo-addend.s: New.
18 lines
260 B
ArmAsm
18 lines
260 B
ArmAsm
.text
|
|
.globl _start
|
|
_start:
|
|
auipc ra, %pcrel_hi(tdata)
|
|
addi ra, ra, %pcrel_lo(.text)
|
|
lb t1, 0(ra)
|
|
foo:
|
|
auipc ra, %pcrel_hi(tdata)
|
|
addi ra, ra, %pcrel_lo(.text+12)
|
|
lb t2, 1(ra)
|
|
|
|
.data
|
|
tdata:
|
|
.byte 0xff
|
|
.byte 0x00
|
|
.byte 0xf0
|
|
.byte 0x0f
|