• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revision0635c8759326e9431604b3359185cbf96740521d (tree)
Zeit2016-02-09 19:36:15
AutorWalfred Tedeschi <walfred.tedeschi@inte...>
CommiterWalfred Tedeschi

Log Message

Revert "Add a more helpful warning message to explain why some AArch64 relocations can overflow."

This reverts commit 2ea53e003163338a403d5afbb2046cafb8f3abe9.

Ändern Zusammenfassung

Diff

--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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-
71 2016-02-05 Simon Marchi <simon.marchi@ericsson.com>
82
93 * pe-mips.c (coff_mips_reloc): Fix formatting.
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -6405,6 +6405,10 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
64056405 break;
64066406 }
64076407
6408+ if (!save_addend)
6409+ addend = 0;
6410+
6411+
64086412 /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
64096413 because such sections are not SEC_ALLOC and thus ld.so will
64106414 not process them. */
@@ -6444,34 +6448,6 @@ elfNN_aarch64_relocate_section (bfd *output_bfd,
64446448 name, input_bfd, input_section, rel->r_offset);
64456449 return FALSE;
64466450 }
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- }
64756451 break;
64766452
64776453 case bfd_reloc_undefined:
@@ -6506,9 +6482,6 @@ alignment than was declared where it was defined."),
65066482 break;
65076483 }
65086484 }
6509-
6510- if (!save_addend)
6511- addend = 0;
65126485 }
65136486
65146487 return TRUE;
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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-
81 2016-02-04 Nick Clifton <nickc@redhat.com>
92
103 * testsuite/ld-arm/arm-elf.exp: Remove ARM NOREAD section tests.
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -159,8 +159,6 @@ run_dump_test "emit-relocs-537"
159159 run_dump_test "emit-relocs-537-overflow"
160160 run_dump_test "emit-relocs-538"
161161
162-run_dump_test "reloc-overflow-bad"
163-
164162 # test addend correctness when --emit-relocs specified for non-relocatable obj.
165163 run_dump_test "emit-relocs-local-addend"
166164 # test addend correctness when -r specified.
@@ -283,9 +281,9 @@ run_dump_test "plt_mapping_symbol"
283281
284282 set aarch64elflinktests {
285283 {"ld-aarch64/so with global symbol" "-shared" "" "" {copy-reloc-so.s}
286- {} "copy-reloc-so.so"}
284+ {} "copy-reloc-so.so"}
287285 {"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"}
289287 }
290288
291289 run_ld_link_tests $aarch64elflinktests
--- a/ld/testsuite/ld-aarch64/reloc-overflow-1.s
+++ /dev/null
@@ -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]"
--- a/ld/testsuite/ld-aarch64/reloc-overflow-2.s
+++ /dev/null
@@ -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]"
--- a/ld/testsuite/ld-aarch64/reloc-overflow-bad.d
+++ /dev/null
@@ -1,4 +0,0 @@
1-#source: reloc-overflow-1.s
2-#source: reloc-overflow-2.s
3-#ld: -e0
4-#error: .*One possible cause.*