From 62c34db3dc2a5a77d28853a650182a26f00896bb Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 14 Aug 2013 12:20:41 +0000 Subject: PR ld/15787 * elf32-arm.c (elf32_arm_final_link_relocate): Use origin of output segment containing the relocating symbol instead of assuming 0 for sb group relocations. * ld-arm/group-relocs-ldr-bad.s: Redefine bar into foo section beyond 16 bit offset width. * ld-arm/group-relocs-ldrs-bad.s: Likewise. * ld-arm/group-relocs-ldr-bad.d: Adjust expected result. * ld-arm/group-relocs-ldrs-bad.d: Likewise. * ld-arm/group-relocs.s: Add comments. Move symbols used for sb group relocations into .data section. Drop section zero. Use pc/r0 as base register when pc/sb group relocations are used. * ld-arm/group-relocs.d: Adjust expected result. * ld-arm/group-relocs-alu-bad-2.d: New test for sb group relocation. * ld-arm/group-relocs-ldc-bad-2.d: Likewise. * ld-arm/group-relocs-ldr-bad-2.d: New test for pc group relocation. * ld-arm/group-relocs-ldrs-bad-2.d: Likewise. * ld-arm/unresolved-2.d: Add sb relocation failure test. * ld-arm/group-relocs-alu-bad-2.s: New test source. * ld-arm/group-relocs-ldr-bad-2.s: Likewise. * ld-arm/group-relocs-ldrs-bad-2.s: Likewise. * ld-arm/group-relocs-ldc-bad-2.s: Likewise. * ld-arm/unresolved-2.s: Likewise. * ld-arm/arm-elf.exp: For group-relocs, drop section zero start definition. Run the new tests. --- ld/testsuite/ld-arm/group-relocs-ldr-bad-2.s | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ld/testsuite/ld-arm/group-relocs-ldr-bad-2.s') diff --git a/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.s b/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.s index 02d01c2..3aec8ee 100644 --- a/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.s +++ b/ld/testsuite/ld-arm/group-relocs-ldr-bad-2.s @@ -6,12 +6,13 @@ .globl _start _start: - add r0, r0, #:sb_g0_nc:(bar) - ldr r1, [r0, #:sb_g1:(bar)] + add r0, r0, #:pc_g0_nc:(bar) + ldr r1, [r0, #:pc_g1:(bar + 4)] -@ We will place the section foo at 0x8001000 but that should be irrelevant -@ for sb_g* relocations. +@ We will place the section foo at 0x8001000. .section foo - .set bar,foo + 0x123456 + +bar: + mov r0, #0 -- cgit v1.1