mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 03:51:15 +08:00
f6cccc2cd8
PR gold/12771 * arm.cc (Arm_relocate_functions::abs8): Use int32_t for addend and Arm_Address type for relocation result. (Arm_relocate_functions::abs16): Use unaligned access. Also fix overflow check. (Arm_relocate_functions::abs32): Use unaligned access. (Arm_relocate_functions::rel32): Ditto. (Arm_relocate_functions::prel31): Ditto. (Arm_exidix_cantunwind::do_fixed_endian_write): Ditto. * testsuite/Makefile.am: Add new test arm_unaligned_reloc for unaligned static data relocations. * testsuite/Makefile.in: Regnerate. * testsuite/arm_unaligned_reloc.{s,sh}: New files.
45 lines
591 B
ArmAsm
45 lines
591 B
ArmAsm
.syntax unified
|
|
|
|
.global _start
|
|
.type _start, %function
|
|
.text
|
|
_start:
|
|
bx lr
|
|
.size _start,.-_start
|
|
|
|
.section .data.0,"aw",%progbits
|
|
.align 12
|
|
.type x, %object
|
|
.size x, 4
|
|
x:
|
|
.word 1
|
|
|
|
.section .data.1,"aw",%progbits
|
|
.align 2
|
|
|
|
# This causes following relocations to be unaligned.
|
|
.global padding
|
|
.type padding, %object
|
|
.size padding, 1
|
|
padding:
|
|
.byte 0
|
|
|
|
.global abs32
|
|
.type abs32, %object
|
|
.size abs32, 4
|
|
abs32:
|
|
.word x
|
|
|
|
.global rel32
|
|
.type rel32, %object
|
|
.size rel32, 4
|
|
rel32:
|
|
.word x - .
|
|
|
|
.global abs16
|
|
.type abs16, %object
|
|
.size abs16, 2
|
|
abs16:
|
|
.short x
|
|
.short 0
|