You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
3.5 KiB
94 lines
3.5 KiB
3 years ago
|
diff -rup binutils.orig/bfd/elfnn-aarch64.c binutils-2.35/bfd/elfnn-aarch64.c
|
||
|
--- binutils.orig/bfd/elfnn-aarch64.c 2020-09-10 17:03:31.738458044 +0100
|
||
|
+++ binutils-2.35/bfd/elfnn-aarch64.c 2020-09-10 17:04:03.643344898 +0100
|
||
|
@@ -5445,7 +5445,6 @@ elfNN_aarch64_final_link_relocate (reloc
|
||
|
bfd_vma orig_value = value;
|
||
|
bfd_boolean resolved_to_zero;
|
||
|
bfd_boolean abs_symbol_p;
|
||
|
- bfd_boolean via_plt_p;
|
||
|
|
||
|
globals = elf_aarch64_hash_table (info);
|
||
|
|
||
|
@@ -5467,8 +5466,6 @@ elfNN_aarch64_final_link_relocate (reloc
|
||
|
: bfd_is_und_section (sym_sec));
|
||
|
abs_symbol_p = h != NULL && bfd_is_abs_symbol (&h->root);
|
||
|
|
||
|
- via_plt_p = (globals->root.splt != NULL && h != NULL
|
||
|
- && h->plt.offset != (bfd_vma) - 1);
|
||
|
|
||
|
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle
|
||
|
it here if it is defined in a non-shared object. */
|
||
|
@@ -5805,23 +5802,12 @@ elfNN_aarch64_final_link_relocate (reloc
|
||
|
value += signed_addend;
|
||
|
break;
|
||
|
|
||
|
- case BFD_RELOC_AARCH64_BRANCH19:
|
||
|
- case BFD_RELOC_AARCH64_TSTBR14:
|
||
|
- /* A conditional branch to an undefined weak symbol is converted to a
|
||
|
- branch to itself. */
|
||
|
- if (weak_undef_p && !via_plt_p)
|
||
|
- {
|
||
|
- value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type,
|
||
|
- place, value,
|
||
|
- signed_addend,
|
||
|
- weak_undef_p);
|
||
|
- break;
|
||
|
- }
|
||
|
- /* Fall through. */
|
||
|
case BFD_RELOC_AARCH64_CALL26:
|
||
|
case BFD_RELOC_AARCH64_JUMP26:
|
||
|
{
|
||
|
asection *splt = globals->root.splt;
|
||
|
+ bfd_boolean via_plt_p =
|
||
|
+ splt != NULL && h != NULL && h->plt.offset != (bfd_vma) - 1;
|
||
|
|
||
|
/* A call to an undefined weak symbol is converted to a jump to
|
||
|
the next instruction unless a PLT entry will be created.
|
||
|
@@ -5902,6 +5888,23 @@ elfNN_aarch64_final_link_relocate (reloc
|
||
|
bfd_set_error (bfd_error_bad_value);
|
||
|
return bfd_reloc_notsupported;
|
||
|
}
|
||
|
+ value = _bfd_aarch64_elf_resolve_relocation (input_bfd, bfd_r_type,
|
||
|
+ place, value,
|
||
|
+ signed_addend,
|
||
|
+ weak_undef_p);
|
||
|
+ break;
|
||
|
+
|
||
|
+ case BFD_RELOC_AARCH64_BRANCH19:
|
||
|
+ case BFD_RELOC_AARCH64_TSTBR14:
|
||
|
+ if (h && h->root.type == bfd_link_hash_undefined)
|
||
|
+ {
|
||
|
+ _bfd_error_handler
|
||
|
+ /* xgettext:c-format */
|
||
|
+ (_("%pB: conditional branch to undefined symbol `%s' "
|
||
|
+ "not allowed"), input_bfd, h->root.root.string);
|
||
|
+ bfd_set_error (bfd_error_bad_value);
|
||
|
+ return bfd_reloc_notsupported;
|
||
|
+ }
|
||
|
/* Fall through. */
|
||
|
|
||
|
case BFD_RELOC_AARCH64_16:
|
||
|
@@ -7967,8 +7970,6 @@ elfNN_aarch64_check_relocs (bfd *abfd, s
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
- case BFD_RELOC_AARCH64_BRANCH19:
|
||
|
- case BFD_RELOC_AARCH64_TSTBR14:
|
||
|
case BFD_RELOC_AARCH64_CALL26:
|
||
|
case BFD_RELOC_AARCH64_JUMP26:
|
||
|
/* If this is a local symbol then we resolve it
|
||
|
Only in binutils-2.35/bfd: elfnn-aarch64.c.orig
|
||
|
diff -rup binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d
|
||
|
--- binutils.orig/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:03:31.067460424 +0100
|
||
|
+++ binutils-2.35/ld/testsuite/ld-aarch64/emit-relocs-560.d 2020-09-10 17:04:03.644344895 +0100
|
||
|
@@ -1,8 +1,3 @@
|
||
|
#source: emit-relocs-560.s
|
||
|
#ld: -shared
|
||
|
-#readelf: -r
|
||
|
-
|
||
|
-Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 2 entries:
|
||
|
- Offset Info Type Sym. Value Sym. Name \+ Addend
|
||
|
-[0-9a-f]+ 000100000402 R_AARCH64_JUMP_SL 0000000000000000 baz \+ 0
|
||
|
-[0-9a-f]+ 000200000402 R_AARCH64_JUMP_SL 0000000000000000 bar \+ 0
|
||
|
+#error: .*: conditional branch to undefined symbol `bar' not allowed
|