GNU Binutils with patches for OS216
Revisão | 6c699715f68be7d8c468e965fbefce997f7ed937 (tree) |
---|---|
Hora | 2017-10-11 00:18:07 |
Autor | Renlin Li <renlin.li@arm....> |
Commiter | Renlin Li |
[ARM] PR ld/21402, only override the symbol dynamic decision on undefined weak symbol.
Similar as aarch64 backend, arm backend only overrides the decision on undefined
weak symbols. arm backend part already emits necessary relative relocation for
this case.
bfd/
PR ld/21402
* elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
symbols into dynamic.
ld/
PR ld/21402
* testsuite/ld-arm/tls-app.d: Update address.
* testsuite/ld-arm/tls-app.r: Remove relocations.
* testsuite/ld-arm/unresolved-1-dyn.d: Update.
@@ -1,3 +1,9 @@ | ||
1 | +2017-10-10 Renlin Li <renlin.li@arm.com> | |
2 | + | |
3 | + PR ld/21402 | |
4 | + * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak | |
5 | + symbols into dynamic. | |
6 | + | |
1 | 7 | 2017-10-09 H.J. Lu <hongjiu.lu@intel.com> |
2 | 8 | |
3 | 9 | PR ld/22274 |
@@ -15443,8 +15443,8 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf) | ||
15443 | 15443 | { |
15444 | 15444 | /* Make sure this symbol is output as a dynamic symbol. |
15445 | 15445 | Undefined weak syms won't yet be marked as dynamic. */ |
15446 | - if (h->dynindx == -1 | |
15447 | - && !h->forced_local) | |
15446 | + if (h->dynindx == -1 && !h->forced_local | |
15447 | + && h->root.type == bfd_link_hash_undefweak) | |
15448 | 15448 | { |
15449 | 15449 | if (! bfd_elf_link_record_dynamic_symbol (info, h)) |
15450 | 15450 | return FALSE; |
@@ -15531,8 +15531,8 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf) | ||
15531 | 15531 | |
15532 | 15532 | /* Make sure this symbol is output as a dynamic symbol. |
15533 | 15533 | Undefined weak syms won't yet be marked as dynamic. */ |
15534 | - if (h->dynindx == -1 | |
15535 | - && !h->forced_local) | |
15534 | + if (h->dynindx == -1 && !h->forced_local | |
15535 | + && h->root.type == bfd_link_hash_undefweak) | |
15536 | 15536 | { |
15537 | 15537 | if (! bfd_elf_link_record_dynamic_symbol (info, h)) |
15538 | 15538 | return FALSE; |
@@ -15755,8 +15755,8 @@ allocate_dynrelocs_for_symbol (struct elf_link_hash_entry *h, void * inf) | ||
15755 | 15755 | { |
15756 | 15756 | /* Make sure this symbol is output as a dynamic symbol. |
15757 | 15757 | Undefined weak syms won't yet be marked as dynamic. */ |
15758 | - if (h->dynindx == -1 | |
15759 | - && !h->forced_local) | |
15758 | + if (h->dynindx == -1 && !h->forced_local | |
15759 | + && h->root.type == bfd_link_hash_undefweak) | |
15760 | 15760 | { |
15761 | 15761 | if (! bfd_elf_link_record_dynamic_symbol (info, h)) |
15762 | 15762 | return FALSE; |
@@ -1,3 +1,10 @@ | ||
1 | +2017-10-10 Renlin Li <renlin.li@arm.com> | |
2 | + | |
3 | + PR ld/21402 | |
4 | + * testsuite/ld-arm/tls-app.d: Update address. | |
5 | + * testsuite/ld-arm/tls-app.r: Remove relocations. | |
6 | + * testsuite/ld-arm/unresolved-1-dyn.d: Update. | |
7 | + | |
1 | 8 | 2017-10-10 Alan Modra <amodra@gmail.com> |
2 | 9 | |
3 | 10 | * Makefile.am (earmelfb_fuchsia.c): Rename rule from earmelf_fuchsia.c. |
@@ -2,17 +2,17 @@ | ||
2 | 2 | .*: file format elf32-.*arm.* |
3 | 3 | architecture: arm.*, flags 0x00000112: |
4 | 4 | EXEC_P, HAS_SYMS, D_PAGED |
5 | -start address 0x000081c8 | |
5 | +start address 0x00008[0-9a-f]+ | |
6 | 6 | |
7 | 7 | Disassembly of section .text: |
8 | 8 | |
9 | -000081c8 <foo>: | |
10 | - 81c8: e1a00000 nop ; \(mov r0, r0\) | |
11 | - 81cc: e1a00000 nop ; \(mov r0, r0\) | |
12 | - 81d0: e1a0f00e mov pc, lr | |
13 | - 81d4: 000080bc .word 0x000080bc | |
14 | - 81d8: 000080b4 .word 0x000080b4 | |
15 | - 81dc: 000080ac .word 0x000080ac | |
16 | - 81e0: 00000004 .word 0x00000004 | |
17 | - 81e4: 000080c4 .word 0x000080c4 | |
18 | - 81e8: 00000014 .word 0x00000014 | |
9 | +00008[0-9a-f]+ <foo>: | |
10 | + 8[0-9a-f]+: e1a00000 nop ; \(mov r0, r0\) | |
11 | + 8[0-9a-f]+: e1a00000 nop ; \(mov r0, r0\) | |
12 | + 8[0-9a-f]+: e1a0f00e mov pc, lr | |
13 | + 8[0-9a-f]+: 000080bc .word 0x000080bc | |
14 | + 8[0-9a-f]+: 000080b4 .word 0x000080b4 | |
15 | + 8[0-9a-f]+: 000080ac .word 0x000080ac | |
16 | + 8[0-9a-f]+: 00000004 .word 0x00000004 | |
17 | + 8[0-9a-f]+: 000080c4 .word 0x000080c4 | |
18 | + 8[0-9a-f]+: 00000014 .word 0x00000014 |
@@ -3,8 +3,5 @@ | ||
3 | 3 | |
4 | 4 | DYNAMIC RELOCATION RECORDS |
5 | 5 | OFFSET TYPE VALUE |
6 | -[0-9a-f]+ R_ARM_TLS_DTPMOD32 app_gd | |
7 | -[0-9a-f]+ R_ARM_TLS_DTPOFF32 app_gd | |
8 | 6 | [0-9a-f]+ R_ARM_TLS_DTPMOD32 lib_gd |
9 | 7 | [0-9a-f]+ R_ARM_TLS_DTPOFF32 lib_gd |
10 | -[0-9a-f]+ R_ARM_TLS_TPOFF32 app_ie |
@@ -5,4 +5,4 @@ | ||
5 | 5 | |
6 | 6 | Relocation section '\.rel\.dyn' .* |
7 | 7 | Offset .* |
8 | -.* R_ARM_GLOB_DAT +00000000 +foo | |
8 | +^.* 00000000 R_ARM_NONE.+ |