GNU Binutils with patches for OS216
Revision | 0635c8759326e9431604b3359185cbf96740521d (tree) |
---|---|
Zeit | 2016-02-09 19:36:15 |
Autor | Walfred Tedeschi <walfred.tedeschi@inte...> |
Commiter | Walfred Tedeschi |
Revert "Add a more helpful warning message to explain why some AArch64 relocations can overflow."
This reverts commit 2ea53e003163338a403d5afbb2046cafb8f3abe9.
@@ -1,9 +1,3 @@ | ||
1 | -2016-02-09 Nick Clifton <nickc@redhat.com> | |
2 | - | |
3 | - * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Add a more | |
4 | - helpful warning message to explain why certain AArch64 relocs | |
5 | - might overflow. | |
6 | - | |
7 | 1 | 2016-02-05 Simon Marchi <simon.marchi@ericsson.com> |
8 | 2 | |
9 | 3 | * pe-mips.c (coff_mips_reloc): Fix formatting. |
@@ -6405,6 +6405,10 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, | ||
6405 | 6405 | break; |
6406 | 6406 | } |
6407 | 6407 | |
6408 | + if (!save_addend) | |
6409 | + addend = 0; | |
6410 | + | |
6411 | + | |
6408 | 6412 | /* Dynamic relocs are not propagated for SEC_DEBUGGING sections |
6409 | 6413 | because such sections are not SEC_ALLOC and thus ld.so will |
6410 | 6414 | not process them. */ |
@@ -6444,34 +6448,6 @@ elfNN_aarch64_relocate_section (bfd *output_bfd, | ||
6444 | 6448 | name, input_bfd, input_section, rel->r_offset); |
6445 | 6449 | return FALSE; |
6446 | 6450 | } |
6447 | - /* Overflow can occur when a variable is referenced with a type | |
6448 | - that has a larger alignment than the type with which it was | |
6449 | - declared. eg: | |
6450 | - file1.c: extern int foo; int a (void) { return foo; } | |
6451 | - file2.c: char bar, foo, baz; | |
6452 | - If the variable is placed into a data section at an offset | |
6453 | - that is incompatible with the larger alignment requirement | |
6454 | - overflow will occur. (Strictly speaking this is not overflow | |
6455 | - but rather an alignment problem, but the bfd_reloc_ error | |
6456 | - enum does not have a value to cover that situation). | |
6457 | - | |
6458 | - Try to catch this situation here and provide a more helpful | |
6459 | - error message to the user. */ | |
6460 | - if (addend & ((1 << howto->rightshift) - 1) | |
6461 | - /* FIXME: Are we testing all of the appropriate reloc | |
6462 | - types here ? */ | |
6463 | - && (real_r_type == BFD_RELOC_AARCH64_LD_LO19_PCREL | |
6464 | - || real_r_type == BFD_RELOC_AARCH64_LDST16_LO12 | |
6465 | - || real_r_type == BFD_RELOC_AARCH64_LDST32_LO12 | |
6466 | - || real_r_type == BFD_RELOC_AARCH64_LDST64_LO12 | |
6467 | - || real_r_type == BFD_RELOC_AARCH64_LDST128_LO12)) | |
6468 | - { | |
6469 | - info->callbacks->warning | |
6470 | - (info, _("One possible cause of this error is that the \ | |
6471 | -symbol is being referenced in the indicated code as if it had a larger \ | |
6472 | -alignment than was declared where it was defined."), | |
6473 | - name, input_bfd, input_section, rel->r_offset); | |
6474 | - } | |
6475 | 6451 | break; |
6476 | 6452 | |
6477 | 6453 | case bfd_reloc_undefined: |
@@ -6506,9 +6482,6 @@ alignment than was declared where it was defined."), | ||
6506 | 6482 | break; |
6507 | 6483 | } |
6508 | 6484 | } |
6509 | - | |
6510 | - if (!save_addend) | |
6511 | - addend = 0; | |
6512 | 6485 | } |
6513 | 6486 | |
6514 | 6487 | return TRUE; |
@@ -1,10 +1,3 @@ | ||
1 | -2016-02-09 Nick Clifton <nickc@redhat.com> | |
2 | - | |
3 | - * testsuite/ld-aarch64/reloc-overflow-bad.d: New test. | |
4 | - * testsuite/ld-aarch64/reloc-overflow-1.s: New source file. | |
5 | - * testsuite/ld-aarch64/reloc-overflow-2.s: New source file. | |
6 | - * testsuite/ld-aarch64/aarch64-elf.exp: Run the new test. | |
7 | - | |
8 | 1 | 2016-02-04 Nick Clifton <nickc@redhat.com> |
9 | 2 | |
10 | 3 | * testsuite/ld-arm/arm-elf.exp: Remove ARM NOREAD section tests. |
@@ -159,8 +159,6 @@ run_dump_test "emit-relocs-537" | ||
159 | 159 | run_dump_test "emit-relocs-537-overflow" |
160 | 160 | run_dump_test "emit-relocs-538" |
161 | 161 | |
162 | -run_dump_test "reloc-overflow-bad" | |
163 | - | |
164 | 162 | # test addend correctness when --emit-relocs specified for non-relocatable obj. |
165 | 163 | run_dump_test "emit-relocs-local-addend" |
166 | 164 | # test addend correctness when -r specified. |
@@ -283,9 +281,9 @@ run_dump_test "plt_mapping_symbol" | ||
283 | 281 | |
284 | 282 | set aarch64elflinktests { |
285 | 283 | {"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s} |
286 | - {} "copy-reloc-so.so"} | |
284 | + {} "copy-reloc-so.so"} | |
287 | 285 | {"ld-aarch64/exe with copy relocation" "-e0 tmpdir/copy-reloc-so.so" "" "" |
288 | - {copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"} | |
286 | + {copy-reloc-exe.s} {{objdump -R copy-reloc.d}} "copy-reloc"} | |
289 | 287 | } |
290 | 288 | |
291 | 289 | run_ld_link_tests $aarch64elflinktests |
@@ -1,14 +0,0 @@ | ||
1 | - .file "1.c" | |
2 | - .text | |
3 | - .align 2 | |
4 | - .p2align 3,,7 | |
5 | - .global dec | |
6 | - .arch armv8-a+fp+simd | |
7 | - //.tune generic | |
8 | - .type dec, %function | |
9 | -dec: | |
10 | - adrp x0, var_2 | |
11 | - ldr w0, [x0, #:lo12:var_2] | |
12 | - ret | |
13 | - .size dec, .-dec | |
14 | - .ident "GCC: (GNU) 6.0.0 20160208 (experimental) [trunk revision 233206]" |
@@ -1,5 +0,0 @@ | ||
1 | - .file "2.c" | |
2 | - .comm var_3,1,1 | |
3 | - .comm var_2,1,1 | |
4 | - .comm var_1,1,1 | |
5 | - .ident "GCC: (GNU) 6.0.0 20160208 (experimental) [trunk revision 233206]" |
@@ -1,4 +0,0 @@ | ||
1 | -#source: reloc-overflow-1.s | |
2 | -#source: reloc-overflow-2.s | |
3 | -#ld: -e0 | |
4 | -#error: .*One possible cause.* |