For AArch64 issue an error message when attempting to resolve a
PC-relative dynamic reloc in a non-PIC object file. Related: 1232499
This commit is contained in:
parent
16714c52b4
commit
3c3e148fe3
53
binutils-2.25-aarch64-fPIC-error.patch
Normal file
53
binutils-2.25-aarch64-fPIC-error.patch
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
--- binutils-2.25.orig/bfd/elfnn-aarch64.c 2015-07-02 14:38:44.178894336 +0100
|
||||||
|
+++ binutils-2.25/bfd/elfnn-aarch64.c 2015-07-02 14:40:39.341603064 +0100
|
||||||
|
@@ -4426,16 +4426,36 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||||
|
signed_addend, weak_undef_p);
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case BFD_RELOC_AARCH64_16_PCREL:
|
||||||
|
+ case BFD_RELOC_AARCH64_32_PCREL:
|
||||||
|
+ case BFD_RELOC_AARCH64_64_PCREL:
|
||||||
|
+ case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
|
||||||
|
+ case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
|
||||||
|
+ case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
|
||||||
|
+ case BFD_RELOC_AARCH64_LD_LO19_PCREL:
|
||||||
|
+ if (info->shared
|
||||||
|
+ && (input_section->flags & SEC_ALLOC) != 0
|
||||||
|
+ && (input_section->flags & SEC_READONLY) != 0
|
||||||
|
+ && h != NULL
|
||||||
|
+ && !h->def_regular)
|
||||||
|
+ {
|
||||||
|
+ int howto_index = bfd_r_type - BFD_RELOC_AARCH64_RELOC_START;
|
||||||
|
+
|
||||||
|
+ (*_bfd_error_handler)
|
||||||
|
+ (_("%B: relocation %s against external symbol `%s' can not be used"
|
||||||
|
+ " when making a shared object; recompile with -fPIC"),
|
||||||
|
+ input_bfd, elfNN_aarch64_howto_table[howto_index].name,
|
||||||
|
+ h->root.root.string);
|
||||||
|
+ bfd_set_error (bfd_error_bad_value);
|
||||||
|
+ return FALSE;
|
||||||
|
+ }
|
||||||
|
+ /* Fall through. */
|
||||||
|
case BFD_RELOC_AARCH64_16:
|
||||||
|
#if ARCH_SIZE == 64
|
||||||
|
case BFD_RELOC_AARCH64_32:
|
||||||
|
#endif
|
||||||
|
case BFD_RELOC_AARCH64_ADD_LO12:
|
||||||
|
- case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
|
||||||
|
- case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
|
||||||
|
- case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
|
||||||
|
case BFD_RELOC_AARCH64_BRANCH19:
|
||||||
|
- case BFD_RELOC_AARCH64_LD_LO19_PCREL:
|
||||||
|
case BFD_RELOC_AARCH64_LDST8_LO12:
|
||||||
|
case BFD_RELOC_AARCH64_LDST16_LO12:
|
||||||
|
case BFD_RELOC_AARCH64_LDST32_LO12:
|
||||||
|
@@ -4451,9 +4471,6 @@ elfNN_aarch64_final_link_relocate (reloc
|
||||||
|
case BFD_RELOC_AARCH64_MOVW_G2:
|
||||||
|
case BFD_RELOC_AARCH64_MOVW_G2_NC:
|
||||||
|
case BFD_RELOC_AARCH64_MOVW_G3:
|
||||||
|
- case BFD_RELOC_AARCH64_16_PCREL:
|
||||||
|
- case BFD_RELOC_AARCH64_32_PCREL:
|
||||||
|
- case BFD_RELOC_AARCH64_64_PCREL:
|
||||||
|
case BFD_RELOC_AARCH64_TSTBR14:
|
||||||
|
value = _bfd_aarch64_elf_resolve_relocation (bfd_r_type, place, value,
|
||||||
|
signed_addend, weak_undef_p);
|
@ -19,7 +19,7 @@
|
|||||||
Summary: A GNU collection of binary utilities
|
Summary: A GNU collection of binary utilities
|
||||||
Name: %{?cross}binutils%{?_with_debug:-debug}
|
Name: %{?cross}binutils%{?_with_debug:-debug}
|
||||||
Version: 2.25
|
Version: 2.25
|
||||||
Release: 11%{?dist}
|
Release: 12%{?dist}
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
Group: Development/Tools
|
Group: Development/Tools
|
||||||
URL: http://sources.redhat.com/binutils
|
URL: http://sources.redhat.com/binutils
|
||||||
@ -54,6 +54,8 @@ Patch13: binutils-2.23.2-aarch64-em.patch
|
|||||||
Patch14: binutils-2.24-ldforcele.patch
|
Patch14: binutils-2.24-ldforcele.patch
|
||||||
# Fix allocation of space for x86_64 PIE relocs.
|
# Fix allocation of space for x86_64 PIE relocs.
|
||||||
Patch15: binutils-2.25-x86_64-pie-relocs.patch
|
Patch15: binutils-2.25-x86_64-pie-relocs.patch
|
||||||
|
# Issue an error message when attempting to resolve PC-relative dynamic relocs in non-PIC objects.
|
||||||
|
Patch16: binutils-2.25-aarch64-fPIC-error.patch
|
||||||
|
|
||||||
|
|
||||||
Provides: bundled(libiberty)
|
Provides: bundled(libiberty)
|
||||||
@ -178,6 +180,10 @@ using libelf instead of BFD.
|
|||||||
%patch14 -p1 -b .ldforcele~
|
%patch14 -p1 -b .ldforcele~
|
||||||
%endif
|
%endif
|
||||||
%patch15 -p1 -b .x86_64-pie~
|
%patch15 -p1 -b .x86_64-pie~
|
||||||
|
%ifarch aarch64
|
||||||
|
%patch16 -p1 -b .aarch64-fpic~
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
|
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
|
||||||
|
|
||||||
@ -490,6 +496,11 @@ exit 0
|
|||||||
%endif # %{isnative}
|
%endif # %{isnative}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jul 02 2015 Nick Clifton <nickc@redhat.com> - 2.25-12
|
||||||
|
- For AArch64 issue an error message when attempting to resolve a
|
||||||
|
PC-relative dynamic reloc in a non-PIC object file.
|
||||||
|
- Related: 1232499
|
||||||
|
|
||||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.25-11
|
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.25-11
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user