mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
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.
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
2013-08-14 John Tytgat <john@bass-software.com>
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
2013-08-09 Nick Clifton <nickc@redhat.com>
|
2013-08-09 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if G10
|
* elf32-rl78.c (rl78_elf_merge_private_bfd_data): Complain if G10
|
||||||
|
@ -9853,7 +9853,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
|||||||
bfd_vma pc = input_section->output_section->vma
|
bfd_vma pc = input_section->output_section->vma
|
||||||
+ input_section->output_offset + rel->r_offset;
|
+ input_section->output_offset + rel->r_offset;
|
||||||
/* sb is the origin of the *segment* containing the symbol. */
|
/* sb is the origin of the *segment* containing the symbol. */
|
||||||
bfd_vma sb = sym_sec->output_section->vma;
|
bfd_vma sb = sym_sec ? sym_sec->output_section->vma : 0;
|
||||||
bfd_vma residual;
|
bfd_vma residual;
|
||||||
bfd_vma g_n;
|
bfd_vma g_n;
|
||||||
bfd_signed_vma signed_value;
|
bfd_signed_vma signed_value;
|
||||||
@ -9987,7 +9987,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
|||||||
bfd_vma pc = input_section->output_section->vma
|
bfd_vma pc = input_section->output_section->vma
|
||||||
+ input_section->output_offset + rel->r_offset;
|
+ input_section->output_offset + rel->r_offset;
|
||||||
/* sb is the origin of the *segment* containing the symbol. */
|
/* sb is the origin of the *segment* containing the symbol. */
|
||||||
bfd_vma sb = sym_sec->output_section->vma;
|
bfd_vma sb = sym_sec ? sym_sec->output_section->vma : 0;
|
||||||
bfd_vma residual;
|
bfd_vma residual;
|
||||||
bfd_signed_vma signed_value;
|
bfd_signed_vma signed_value;
|
||||||
int group = 0;
|
int group = 0;
|
||||||
@ -10071,7 +10071,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
|||||||
bfd_vma pc = input_section->output_section->vma
|
bfd_vma pc = input_section->output_section->vma
|
||||||
+ input_section->output_offset + rel->r_offset;
|
+ input_section->output_offset + rel->r_offset;
|
||||||
/* sb is the origin of the *segment* containing the symbol. */
|
/* sb is the origin of the *segment* containing the symbol. */
|
||||||
bfd_vma sb = sym_sec->output_section->vma;
|
bfd_vma sb = sym_sec ? sym_sec->output_section->vma : 0;
|
||||||
bfd_vma residual;
|
bfd_vma residual;
|
||||||
bfd_signed_vma signed_value;
|
bfd_signed_vma signed_value;
|
||||||
int group = 0;
|
int group = 0;
|
||||||
@ -10155,7 +10155,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
|
|||||||
bfd_vma pc = input_section->output_section->vma
|
bfd_vma pc = input_section->output_section->vma
|
||||||
+ input_section->output_offset + rel->r_offset;
|
+ input_section->output_offset + rel->r_offset;
|
||||||
/* sb is the origin of the *segment* containing the symbol. */
|
/* sb is the origin of the *segment* containing the symbol. */
|
||||||
bfd_vma sb = sym_sec->output_section->vma;
|
bfd_vma sb = sym_sec ? sym_sec->output_section->vma : 0;
|
||||||
bfd_vma residual;
|
bfd_vma residual;
|
||||||
bfd_signed_vma signed_value;
|
bfd_signed_vma signed_value;
|
||||||
int group = 0;
|
int group = 0;
|
||||||
|
@ -1,3 +1,28 @@
|
|||||||
|
2013-08-14 John Tytgat <john@bass-software.com>
|
||||||
|
|
||||||
|
PR ld/15787
|
||||||
|
* 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.
|
||||||
|
|
||||||
2013-08-09 Nick Clifton <nickc@redhat.com>
|
2013-08-09 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* lib/ld-lib.exp (check_shared_lib_support): Note that the RL78
|
* lib/ld-lib.exp (check_shared_lib_support): Note that the RL78
|
||||||
|
@ -836,4 +836,5 @@ run_dump_test "unresolved-1"
|
|||||||
if { ![istarget "arm*-*-nacl*"] } {
|
if { ![istarget "arm*-*-nacl*"] } {
|
||||||
run_dump_test "unresolved-1-dyn"
|
run_dump_test "unresolved-1-dyn"
|
||||||
}
|
}
|
||||||
|
run_dump_test "unresolved-2"
|
||||||
run_dump_test "gc-hidden-1"
|
run_dump_test "gc-hidden-1"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#name: LDR group relocations failure test
|
#name: LDR group relocations failure test
|
||||||
#source: group-relocs-ldr-bad-2.s
|
#source: group-relocs-ldr-bad-2.s
|
||||||
#ld: -Ttext 0x8000 --section-start foo=0x8001000
|
#ld: -Ttext 0x8000 --section-start foo=0x8001000
|
||||||
#error: .*Overflow whilst splitting 0x123456 for group relocation.*
|
#error: .*Overflow whilst splitting 0x7ff9000 for group relocation.*
|
||||||
|
@ -6,12 +6,13 @@
|
|||||||
.globl _start
|
.globl _start
|
||||||
|
|
||||||
_start:
|
_start:
|
||||||
add r0, r0, #:sb_g0_nc:(bar)
|
add r0, r0, #:pc_g0_nc:(bar)
|
||||||
ldr r1, [r0, #:sb_g1:(bar)]
|
ldr r1, [r0, #:pc_g1:(bar + 4)]
|
||||||
|
|
||||||
@ We will place the section foo at 0x8001000 but that should be irrelevant
|
@ We will place the section foo at 0x8001000.
|
||||||
@ for sb_g* relocations.
|
|
||||||
|
|
||||||
.section foo
|
.section foo
|
||||||
.set bar,foo + 0x123456
|
|
||||||
|
bar:
|
||||||
|
mov r0, #0
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#name: LDR group relocations failure test
|
#name: LDR group relocations failure test
|
||||||
#source: group-relocs-ldr-bad.s
|
#source: group-relocs-ldr-bad.s
|
||||||
#ld: -Ttext 0x8000 --section-start foo=0x8001000
|
#ld: -Ttext 0x8000 --section-start foo=0x8001000
|
||||||
#error: .*Overflow whilst splitting 0x7ff9000 for group relocation.*
|
#error: .*Overflow whilst splitting 0x123456 for group relocation.*
|
||||||
|
@ -6,13 +6,12 @@
|
|||||||
.globl _start
|
.globl _start
|
||||||
|
|
||||||
_start:
|
_start:
|
||||||
add r0, r0, #:pc_g0_nc:(bar)
|
add r0, r0, #:sb_g0_nc:(bar)
|
||||||
ldr r1, [r0, #:pc_g1:(bar + 4)]
|
ldr r1, [r0, #:sb_g1:(bar)]
|
||||||
|
|
||||||
@ We will place the section foo at 0x8001000.
|
@ We will place the section foo at 0x8001000 but that should be irrelevant
|
||||||
|
@ for sb_g* relocations.
|
||||||
|
|
||||||
.section foo
|
.section foo
|
||||||
|
.set bar,foo + 0x123456
|
||||||
bar:
|
|
||||||
mov r0, #0
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#name: LDRS group relocations failure test
|
#name: LDRS group relocations failure test
|
||||||
#source: group-relocs-ldrs-bad-2.s
|
#source: group-relocs-ldrs-bad-2.s
|
||||||
#ld: -Ttext 0x8000 --section-start foo=0x8000100
|
#ld: -Ttext 0x8000 --section-start foo=0x8000100
|
||||||
#error: Overflow whilst splitting 0x123456 for group relocation
|
#error: Overflow whilst splitting 0x7ff8100 for group relocation
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
.globl _start
|
.globl _start
|
||||||
|
|
||||||
_start:
|
_start:
|
||||||
add r0, r0, #:sb_g0_nc:(bar)
|
add r0, r0, #:pc_g0_nc:(bar)
|
||||||
ldrd r2, [r0, #:sb_g1:(bar)]
|
ldrd r2, [r0, #:pc_g1:(bar + 4)]
|
||||||
|
|
||||||
@ We will place the section foo at 0x8000100 but that should be irrelevant
|
@ We will place the section foo at 0x8000100.
|
||||||
@ for sb_g* relocations.
|
|
||||||
|
|
||||||
.section foo
|
.section foo
|
||||||
.set bar,foo + 0x123456
|
|
||||||
|
|
||||||
|
bar:
|
||||||
|
mov r0, #0
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#name: LDRS group relocations failure test
|
#name: LDRS group relocations failure test
|
||||||
#source: group-relocs-ldrs-bad.s
|
#source: group-relocs-ldrs-bad.s
|
||||||
#ld: -Ttext 0x8000 --section-start foo=0x8000100
|
#ld: -Ttext 0x8000 --section-start foo=0x8000100
|
||||||
#error: Overflow whilst splitting 0x7ff8100 for group relocation
|
#error: Overflow whilst splitting 0x123456 for group relocation
|
||||||
|
@ -6,12 +6,12 @@
|
|||||||
.globl _start
|
.globl _start
|
||||||
|
|
||||||
_start:
|
_start:
|
||||||
add r0, r0, #:pc_g0_nc:(bar)
|
add r0, r0, #:sb_g0_nc:(bar)
|
||||||
ldrd r2, [r0, #:pc_g1:(bar + 4)]
|
ldrd r2, [r0, #:sb_g1:(bar)]
|
||||||
|
|
||||||
@ We will place the section foo at 0x8000100.
|
@ We will place the section foo at 0x8000100 but that should be irrelevant
|
||||||
|
@ for sb_g* relocations.
|
||||||
|
|
||||||
.section foo
|
.section foo
|
||||||
|
.set bar,foo + 0x123456
|
||||||
|
|
||||||
bar:
|
|
||||||
mov r0, #0
|
|
||||||
|
5
ld/testsuite/ld-arm/unresolved-2.d
Normal file
5
ld/testsuite/ld-arm/unresolved-2.d
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#name: SB relocations failure test
|
||||||
|
#source: unresolved-2.s
|
||||||
|
#ld:
|
||||||
|
#error: \(\.text\+0x0\): undefined reference to `foo'
|
||||||
|
|
5
ld/testsuite/ld-arm/unresolved-2.s
Normal file
5
ld/testsuite/ld-arm/unresolved-2.s
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
.text
|
||||||
|
.globl _start
|
||||||
|
_start:
|
||||||
|
ldr r1, [r0, #:sb_g0:(foo)]
|
||||||
|
|
Reference in New Issue
Block a user