Browse Source
This patch changes linker to issue a warning for relocation in readonly section for -z text. bfd/ PR ld/17935 * elf32-i386.c (elf_i386_readonly_dynrelocs): Also issue a warning for relocation in readonly section for -z text. (elf_i386_size_dynamic_sections): Likewise. * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise. (elf_x86_64_size_dynamic_sections): Likewise. ld/testsuite/ PR ld/17935 * ld-i386/i386.exp: Run pr17935-1 and pr17935-2. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr17935-1.d: New file. * ld-i386/pr17935-1.s: Likewise. * ld-i386/pr17935-2.d: Likewise. * ld-i386/pr17935-2.s: Likewise. * ld-x86-64/pr17935-1.d: Likewise. * ld-x86-64/pr17935-1.s: Likewise. * ld-x86-64/pr17935-2.d: Likewise. * ld-x86-64/pr17935-2.s: Likewise.gdb-7.10-branch
14 changed files with 78 additions and 8 deletions
@ -0,0 +1,3 @@ |
|||
# as: --32 |
|||
# ld: -m elf_i386 -shared -z text |
|||
# error: warning: relocation against `foo' in readonly section `.text' |
|||
@ -0,0 +1,7 @@ |
|||
.text |
|||
.globl foo |
|||
foo: |
|||
.byte 0 |
|||
.globl bar |
|||
bar: |
|||
.dc.a foo |
|||
@ -0,0 +1,3 @@ |
|||
# as: --32 |
|||
# ld: -m elf_i386 -shared -z text |
|||
# error: warning: relocation in readonly section `.text' |
|||
@ -0,0 +1,6 @@ |
|||
.text |
|||
foo: |
|||
.byte 0 |
|||
.globl bar |
|||
bar: |
|||
.dc.a foo |
|||
@ -0,0 +1,3 @@ |
|||
# as: --64 |
|||
# ld: -m elf_x86_64 -shared -z text |
|||
# error: warning: relocation against `foo' in readonly section `.text' |
|||
@ -0,0 +1,7 @@ |
|||
.text |
|||
.globl foo |
|||
foo: |
|||
.byte 0 |
|||
.globl bar |
|||
bar: |
|||
.dc.a foo |
|||
@ -0,0 +1,3 @@ |
|||
# as: --64 |
|||
# ld: -m elf_x86_64 -shared -z text |
|||
# error: warning: relocation in readonly section `.text' |
|||
@ -0,0 +1,6 @@ |
|||
.text |
|||
foo: |
|||
.byte 0 |
|||
.globl bar |
|||
bar: |
|||
.dc.a foo |
|||
Loading…
Reference in new issue