Rebase on FSF binutils 2.27 release.

- Retire: binutils-2.26-formatting.patch
- Retire: binutils-2.26-Bsymbolic_PIE.patch
- Retire: binutils-rh1312151.patch
- Retire: binutils-2.26-fix-GOT-offset-calculation.patch
- Retire: binutils-2.26-common-definitions.patch
- Retire: binutils-2.26-x86-PIE-relocations.patch
This commit is contained in:
Nick Clifton 2016-08-03 17:43:40 +01:00
parent a302c15623
commit c1bb236faf
12 changed files with 83 additions and 795 deletions

View File

@ -1,16 +0,0 @@
--- binutils-2.26.orig/bfd/elf.c 2016-01-25 10:11:33.482288877 +0000
+++ binutils-2.26/bfd/elf.c 2016-01-25 10:16:48.520223863 +0000
@@ -1300,6 +1300,13 @@ _bfd_elf_copy_private_bfd_data (bfd *ibf
}
}
+ /* If the input BFD has the OSABI field set and the
+ output BFD does not, then copy the value. */
+ if (elf_elfheader (ibfd)->e_ident [EI_OSABI] != ELFOSABI_NONE
+ && elf_elfheader (obfd)->e_ident [EI_OSABI] == ELFOSABI_NONE)
+ elf_elfheader (obfd)->e_ident [EI_OSABI] =
+ elf_elfheader (ibfd)->e_ident [EI_OSABI];
+
return TRUE;
}

View File

@ -1,58 +1,13 @@
diff -upr ../binutils-2.22.52.0.1.orig/ld/testsuite/config/default.exp ld/testsuite/config/default.exp
--- a/ld/testsuite/config/default.exp 2012-03-06 14:00:31.141957656 +0000
+++ b/ld/testsuite/config/default.exp 2012-03-06 14:09:33.492940503 +0000
@@ -23,7 +23,7 @@
#
if ![info exists ld] then {
- set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
+ set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro"
}
if ![info exists as] then {
@@ -60,7 +60,7 @@ if {![file isdirectory tmpdir/ld]} then
catch "exec ln -s ld tmpdir/ld/collect-ld" status
catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status
}
-set gcc_B_opt "-B[pwd]/tmpdir/ld/"
+set gcc_B_opt "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
# load the linker path
set ld_L_opt ""
@@ -279,7 +279,7 @@
}
if ![info exists LD] then {
- set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
+ set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
}
if ![info exists LDFLAGS] then {
diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp ld/testsuite/ld-bootstrap/bootstrap.exp
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 14:00:30.503957676 +0000
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 15:03:33.949837926 +0000
@@ -71,7 +71,13 @@
# This test can only be run if we have the ld build directory,
# since we need the object files.
- if {$ld != "$objdir/ld-new"} {
+ set ldexe $ld
+ set ldparm [string first " " $ld]
+ if { $ldparm > 0 } then {
+ set ldparm [expr $ldparm - 1]
+ set ldexe [string range $ld 0 $ldparm]
+ }
+ if {$ldexe != "$objdir/ld-new"} {
untested $testname
continue
}
--- binutils-2.26.orig/ld/emultempl/elf32.em 2016-01-25 10:11:33.990291993 +0000
+++ binutils-2.26/ld/emultempl/elf32.em 2016-01-25 10:21:40.333016777 +0000
@@ -104,6 +104,7 @@ gld${EMULATION_NAME}_before_parse (void)
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
`if test -n "$CALL_NOP_BYTE" ; then echo link_info.call_nop_byte = $CALL_NOP_BYTE; fi`;
+ link_info.relro = TRUE;
}
EOF
--- binutils-2.27.orig/ld/configure.tgt 2016-07-07 11:16:49.967963649 +0100
+++ binutils-2.27/ld/configure.tgt 2016-07-07 11:17:02.252045673 +0100
@@ -901,8 +901,8 @@ frv-*-* | hppa*-*-* | ia64-*-* | mips*-*
# FAIL: objcopy -shared -z relro (tbss2)
# FAIL: objcopy -shared -z relro (tbss3)
;;
-*-*-linux*)
- if test ${ac_default_ld_z_relro} = unset; then
+*)
+ if test x${ac_default_ld_z_relro} = xunset; then
ac_default_ld_z_relro=1
fi
;;

View File

@ -1,146 +0,0 @@
diff -upr binutils-2.26.orig/ld/ld.texinfo binutils-2.26/ld/ld.texinfo
--- binutils-2.26.orig/ld/ld.texinfo 2016-02-16 10:45:43.245336561 +0000
+++ binutils-2.26/ld/ld.texinfo 2016-02-16 10:47:04.670763451 +0000
@@ -1325,15 +1325,21 @@ libraries.
When creating a shared library, bind references to global symbols to the
definition within the shared library, if any. Normally, it is possible
for a program linked against a shared library to override the definition
-within the shared library. This option is only meaningful on ELF
-platforms which support shared libraries.
+within the shared library. This option can also be used with the
+@option{--export-dynamic} option, when creating a position independent
+executable, to bind references to global symbols to the definition within
+the executable. This option is only meaningful on ELF platforms which
+support shared libraries and position independent executables.
@kindex -Bsymbolic-functions
@item -Bsymbolic-functions
When creating a shared library, bind references to global function
symbols to the definition within the shared library, if any.
+This option can also be used with the @option{--export-dynamic} option,
+when creating a position independent executable, to bind references
+to global function symbols to the definition within the executable.
This option is only meaningful on ELF platforms which support shared
-libraries.
+libraries and position independent executables.
@kindex --dynamic-list=@var{dynamic-list-file}
@item --dynamic-list=@var{dynamic-list-file}
diff -upr binutils-2.26.orig/ld/lexsup.c binutils-2.26/ld/lexsup.c
--- binutils-2.26.orig/ld/lexsup.c 2016-02-16 10:45:43.246336567 +0000
+++ binutils-2.26/ld/lexsup.c 2016-02-16 10:47:04.671763456 +0000
@@ -1586,15 +1586,14 @@ parse_args (unsigned argc, char **argv)
/* We may have -Bsymbolic, -Bsymbolic-functions, --dynamic-list-data,
--dynamic-list-cpp-new, --dynamic-list-cpp-typeinfo and
--dynamic-list FILE. -Bsymbolic and -Bsymbolic-functions are
- for shared libraries. -Bsymbolic overrides all others and vice
- versa. */
+ for PIC outputs. -Bsymbolic overrides all others and vice versa. */
switch (command_line.symbolic)
{
case symbolic_unset:
break;
case symbolic:
- /* -Bsymbolic is for shared library only. */
- if (bfd_link_dll (&link_info))
+ /* -Bsymbolic is for PIC output only. */
+ if (bfd_link_pic (&link_info))
{
link_info.symbolic = TRUE;
/* Should we free the unused memory? */
@@ -1603,8 +1602,8 @@ parse_args (unsigned argc, char **argv)
}
break;
case symbolic_functions:
- /* -Bsymbolic-functions is for shared library only. */
- if (bfd_link_dll (&link_info))
+ /* -Bsymbolic-functions is for PIC output only. */
+ if (bfd_link_pic (&link_info))
command_line.dynamic_list = dynamic_list_data;
break;
}
diff -upr binutils-2.26.orig/ld/testsuite/ld-i386/i386.exp binutils-2.26/ld/testsuite/ld-i386/i386.exp
--- binutils-2.26.orig/ld/testsuite/ld-i386/i386.exp 2016-02-16 10:45:43.319336949 +0000
+++ binutils-2.26/ld/testsuite/ld-i386/i386.exp 2016-02-16 10:47:04.672763461 +0000
@@ -319,6 +319,7 @@ run_dump_test "load5a"
run_dump_test "load5b"
run_dump_test "load6"
run_dump_test "pr19175"
+run_dump_test "pr19615"
if { !([istarget "i?86-*-linux*"]
|| [istarget "i?86-*-gnu*"]
--- /dev/null 2016-02-16 08:27:18.513962320 +0000
+++ binutils-2.26/ld/testsuite/ld-i386/pr19615.s 2016-02-16 10:56:11.886632341 +0000
@@ -0,0 +1,13 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ ret
+
+ .globl xyzzy /* This symbol should be exported */
+ .type xyzzy, @function
+xyzzy:
+ ret
+
+ .section ".xyzzy_ptr","aw",%progbits
+ .dc.a xyzzy
--- /dev/null 2016-02-16 08:27:18.513962320 +0000
+++ binutils-2.26/ld/testsuite/ld-i386/pr19615.d 2016-02-16 10:56:11.886632341 +0000
@@ -0,0 +1,13 @@
+#as: --32
+#ld: -pie -Bsymbolic -E -melf_i386
+#readelf: -r --wide --dyn-syms
+
+Relocation section '.rel.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+ Offset Info Type Sym. Value Symbol's Name
+[0-9a-f]+ +[0-9a-f]+ +R_386_RELATIVE +
+
+Symbol table '.dynsym' contains [0-9]+ entries:
+ Num: Value Size Type Bind Vis Ndx Name
+#...
+[ ]*[a-f0-9]+: [a-f0-9]+ 0 FUNC GLOBAL DEFAULT [a-f0-9]+ xyzzy
+#...
--- /dev/null 2016-02-16 08:27:18.513962320 +0000
+++ binutils-2.26/ld/testsuite/ld-x86-64/pr19615.s 2016-02-16 10:57:55.386174958 +0000
@@ -0,0 +1,13 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ ret
+
+ .globl xyzzy /* This symbol should be exported */
+ .type xyzzy, @function
+xyzzy:
+ ret
+
+ .section ".xyzzy_ptr","aw",%progbits
+ .dc.a xyzzy
--- /dev/null 2016-02-16 08:27:18.513962320 +0000
+++ binutils-2.26/ld/testsuite/ld-x86-64/pr19615.d 2016-02-16 10:57:55.386174958 +0000
@@ -0,0 +1,13 @@
+#as: --64
+#ld: -pie -Bsymbolic -E -melf_x86_64
+#readelf: -r --wide --dyn-syms
+
+Relocation section '.rela.dyn' at offset 0x[0-9a-f]+ contains 1 entries:
+ Offset Info Type Symbol's Value Symbol's Name \+ Addend
+[0-9a-f]+ +[0-9a-f]+ +R_X86_64_RELATIVE +[0-9]+
+
+Symbol table '.dynsym' contains [0-9]+ entries:
+ Num: Value Size Type Bind Vis Ndx Name
+#...
+[ ]*[a-f0-9]+: [a-f0-9]+ 0 FUNC GLOBAL DEFAULT [a-f0-9]+ xyzzy
+#...
--- binutils-2.26.orig/ld/testsuite/ld-x86-64/x86-64.exp 2016-02-16 10:45:43.443337600 +0000
+++ binutils-2.26/ld/testsuite/ld-x86-64/x86-64.exp 2016-02-16 11:01:02.418162157 +0000
@@ -353,6 +353,7 @@ run_dump_test "pr19013-x32"
run_dump_test "pr19013-nacl"
run_dump_test "pr19162"
run_dump_test "pr19175"
+run_dump_test "pr19615"
# Add $PLT_CFLAGS if PLT is expected.
global PLT_CFLAGS

View File

@ -1,21 +0,0 @@
--- binutils-2.26.orig/bfd/elflink.c 2016-03-14 17:11:13.628349614 +0000
+++ binutils-2.26/bfd/elflink.c 2016-03-14 17:20:56.512569366 +0000
@@ -1485,13 +1485,16 @@ _bfd_elf_merge_symbol (bfd *abfd,
represent variables; this can cause confusion in principle, but
any such confusion would seem to indicate an erroneous program or
shared library. We also permit a common symbol in a regular
- object to override a weak symbol in a shared object. */
+ object to override a weak symbol in a shared object. A common
+ symbol in executable also overrides a symbol in a shared object. */
if (newdyn
&& newdef
&& (olddef
|| (h->root.type == bfd_link_hash_common
- && (newweak || newfunc))))
+ && (newweak
+ || newfunc
+ || (!olddyn && bfd_link_executable (info))))))
{
*override = TRUE;
newdef = FALSE;

View File

@ -1,17 +0,0 @@
--- binutils-2.26.orig/bfd/elf32-i386.c 2016-02-29 15:47:45.172597805 +0000
+++ binutils-2.26/bfd/elf32-i386.c 2016-02-29 15:48:42.161904973 +0000
@@ -4016,10 +4016,12 @@ elf_i386_relocate_section (bfd *output_b
/* It is relative to .got.plt section. */
if (h->got.offset != (bfd_vma) -1)
- /* Use GOT entry. */
+ /* Use GOT entry. Mask off the least significant bit in
+ GOT offset which may be set by R_386_GOT32 processing
+ below. */
relocation = (htab->elf.sgot->output_section->vma
+ htab->elf.sgot->output_offset
- + h->got.offset - offplt);
+ + (h->got.offset & ~1) - offplt);
else
/* Use GOTPLT entry. */
relocation = (h->plt.offset / plt_entry_size - 1 + 3) * 4;

View File

@ -36,54 +36,3 @@
// Reloc_stub methods.
// Determine the type of stub needed, if any, for a relocation of R_TYPE at
--- binutils-2.26.orig/gas/config/tc-arm.c 2016-02-04 10:31:44.893794316 +0000
+++ binutils-2.26/gas/config/tc-arm.c 2016-02-04 12:41:25.534564806 +0000
@@ -155,10 +155,12 @@ static const arm_feature_set *object_arc
/* Constants for known architecture features. */
static const arm_feature_set fpu_default = FPU_DEFAULT;
-static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1;
static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2;
+#if 0
+static const arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1;
static const arm_feature_set fpu_arch_vfp_v3 = FPU_ARCH_VFP_V3;
static const arm_feature_set fpu_arch_neon_v1 = FPU_ARCH_NEON_V1;
+#endif
static const arm_feature_set fpu_arch_fpa = FPU_ARCH_FPA;
static const arm_feature_set fpu_any_hard = FPU_ANY_HARD;
static const arm_feature_set fpu_arch_maverick = FPU_ARCH_MAVERICK;
@@ -210,7 +212,9 @@ static const arm_feature_set arm_ext_vir
static const arm_feature_set arm_ext_pan = ARM_FEATURE_CORE_HIGH (ARM_EXT2_PAN);
static const arm_feature_set arm_arch_any = ARM_ANY;
+#if 0
static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1, -1);
+#endif
static const arm_feature_set arm_arch_t2 = ARM_ARCH_THUMB2;
static const arm_feature_set arm_arch_none = ARM_ARCH_NONE;
static const arm_feature_set arm_arch_v6m_only = ARM_ARCH_V6M_ONLY;
@@ -259,8 +263,10 @@ static const arm_feature_set fpu_crypto_
ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8);
static const arm_feature_set crc_ext_armv8 =
ARM_FEATURE_COPROC (CRC_EXT_ARMV8);
+#if 0
static const arm_feature_set fpu_neon_ext_v8_1 =
ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8 | FPU_NEON_EXT_RDMA);
+#endif
static int mfloat_abi_opt = -1;
/* Record user cpu selection for object attributes. */
--- binutils-2.26.orig/gas/config/tc-arm.c 2016-05-09 17:21:37.239766096 +0100
+++ binutils-2.26/gas/config/tc-arm.c 2016-05-09 17:23:08.410319859 +0100
@@ -1982,6 +1982,11 @@ parse_neon_el_struct_list (char **str, u
const char *const type_error = _("mismatched element/structure types in list");
struct neon_typed_alias firsttype;
+ firsttype.defined = 0;
+ firsttype.eltype.type = NT_invtype;
+ firsttype.eltype.size = -1;
+ firsttype.index = -1;
+
if (skip_past_char (&ptr, '{') == SUCCESS)
leading_brace = 1;

View File

@ -1,297 +0,0 @@
--- ../binutils-2.26.orig/bfd/coff-i386.c 2016-02-04 10:31:44.684793142 +0000
+++ bfd/coff-i386.c 2016-02-04 10:32:02.106891045 +0000
@@ -139,41 +139,41 @@ coff_i386_reloc (bfd *abfd,
#define DOIT(x) \
x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
- if (diff != 0)
- {
- reloc_howto_type *howto = reloc_entry->howto;
- unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+ if (diff != 0)
+ {
+ reloc_howto_type *howto = reloc_entry->howto;
+ unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+ switch (howto->size)
+ {
+ case 0:
+ {
+ char x = bfd_get_8 (abfd, addr);
+ DOIT (x);
+ bfd_put_8 (abfd, x, addr);
+ }
+ break;
- switch (howto->size)
+ case 1:
{
- case 0:
- {
- char x = bfd_get_8 (abfd, addr);
- DOIT (x);
- bfd_put_8 (abfd, x, addr);
- }
- break;
-
- case 1:
- {
- short x = bfd_get_16 (abfd, addr);
- DOIT (x);
- bfd_put_16 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- case 2:
- {
- long x = bfd_get_32 (abfd, addr);
- DOIT (x);
- bfd_put_32 (abfd, (bfd_vma) x, addr);
- }
- break;
+ short x = bfd_get_16 (abfd, addr);
+ DOIT (x);
+ bfd_put_16 (abfd, (bfd_vma) x, addr);
+ }
+ break;
- default:
- abort ();
+ case 2:
+ {
+ long x = bfd_get_32 (abfd, addr);
+ DOIT (x);
+ bfd_put_32 (abfd, (bfd_vma) x, addr);
}
- }
+ break;
+
+ default:
+ abort ();
+ }
+ }
/* Now let bfd_perform_relocation finish everything up. */
return bfd_reloc_continue;
--- ../binutils-2.26.orig/bfd/coff-x86_64.c 2016-02-04 10:31:44.686793153 +0000
+++ bfd/coff-x86_64.c 2016-02-04 10:33:02.044227862 +0000
@@ -138,59 +138,61 @@ coff_amd64_reloc (bfd *abfd,
#define DOIT(x) \
x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + diff) & howto->dst_mask))
- if (diff != 0)
- {
- reloc_howto_type *howto = reloc_entry->howto;
- unsigned char *addr = (unsigned char *) data + reloc_entry->address;
-
- /* FIXME: We do not have an end address for data, so we cannot
- accurately range check any addresses computed against it.
- cf: PR binutils/17512: file: 1085-1761-0.004.
- For now we do the best that we can. */
- if (addr < (unsigned char *) data || addr > ((unsigned char *) data) + input_section->size)
+ if (diff != 0)
+ {
+ reloc_howto_type *howto = reloc_entry->howto;
+ unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+ /* FIXME: We do not have an end address for data, so we cannot
+ accurately range check any addresses computed against it.
+ cf: PR binutils/17512: file: 1085-1761-0.004.
+ For now we do the best that we can. */
+ if (addr < (unsigned char *) data
+ || addr > ((unsigned char *) data) + input_section->size)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return bfd_reloc_notsupported;
+ }
+
+ switch (howto->size)
+ {
+ case 0:
{
- bfd_set_error (bfd_error_bad_value);
- return bfd_reloc_notsupported;
+ char x = bfd_get_8 (abfd, addr);
+ DOIT (x);
+ bfd_put_8 (abfd, x, addr);
}
+ break;
- switch (howto->size)
+ case 1:
{
- case 0:
- {
- char x = bfd_get_8 (abfd, addr);
- DOIT (x);
- bfd_put_8 (abfd, x, addr);
- }
- break;
-
- case 1:
- {
- short x = bfd_get_16 (abfd, addr);
- DOIT (x);
- bfd_put_16 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- case 2:
- {
- long x = bfd_get_32 (abfd, addr);
- DOIT (x);
- bfd_put_32 (abfd, (bfd_vma) x, addr);
- }
- break;
- case 4:
- {
- long long x = bfd_get_64 (abfd, addr);
- DOIT (x);
- bfd_put_64 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- default:
- bfd_set_error (bfd_error_bad_value);
- return bfd_reloc_notsupported;
+ short x = bfd_get_16 (abfd, addr);
+ DOIT (x);
+ bfd_put_16 (abfd, (bfd_vma) x, addr);
}
- }
+ break;
+
+ case 2:
+ {
+ long x = bfd_get_32 (abfd, addr);
+ DOIT (x);
+ bfd_put_32 (abfd, (bfd_vma) x, addr);
+ }
+ break;
+
+ case 4:
+ {
+ long long x = bfd_get_64 (abfd, addr);
+ DOIT (x);
+ bfd_put_64 (abfd, (bfd_vma) x, addr);
+ }
+ break;
+
+ default:
+ bfd_set_error (bfd_error_bad_value);
+ return bfd_reloc_notsupported;
+ }
+ }
/* Now let bfd_perform_relocation finish everything up. */
return bfd_reloc_continue;
--- ../binutils-2.26.orig/bfd/elf64-s390.c 2016-02-09 15:01:11.983640775 +0000
+++ bfd/elf64-s390.c 2016-02-09 15:01:37.675779605 +0000
@@ -337,10 +337,10 @@ elf_s390_reloc_name_lookup (bfd *abfd AT
&& strcasecmp (elf_howto_table[i].name, r_name) == 0)
return &elf_howto_table[i];
- if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0)
- return &elf64_s390_vtinherit_howto;
- if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0)
- return &elf64_s390_vtentry_howto;
+ if (strcasecmp (elf64_s390_vtinherit_howto.name, r_name) == 0)
+ return &elf64_s390_vtinherit_howto;
+ if (strcasecmp (elf64_s390_vtentry_howto.name, r_name) == 0)
+ return &elf64_s390_vtentry_howto;
return NULL;
}
--- ../binutils-2.26.orig/bfd/pe-mips.c 2016-02-09 15:01:11.995640840 +0000
+++ bfd/pe-mips.c 2016-02-09 15:31:21.348317265 +0000
@@ -95,44 +95,44 @@ coff_mips_reloc (bfd *abfd,
#define DOIT(x) \
x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + (diff >> howto->rightshift)) & howto->dst_mask))
- if (diff != 0)
- {
- reloc_howto_type *howto = reloc_entry->howto;
- unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+ if (diff != 0)
+ {
+ reloc_howto_type *howto = reloc_entry->howto;
+ unsigned char *addr = (unsigned char *) data + reloc_entry->address;
+
+ switch (howto->size)
+ {
+ case 0:
+ {
+ char x = bfd_get_8 (abfd, addr);
+
+ DOIT (x);
+ bfd_put_8 (abfd, x, addr);
+ }
+ break;
+
+ case 1:
+ {
+ short x = bfd_get_16 (abfd, addr);
+
+ DOIT (x);
+ bfd_put_16 (abfd, (bfd_vma) x, addr);
+ }
+ break;
- switch (howto->size)
+ case 2:
{
- case 0:
- {
- char x = bfd_get_8 (abfd, addr);
-
- DOIT (x);
- bfd_put_8 (abfd, x, addr);
- }
- break;
-
- case 1:
- {
- short x = bfd_get_16 (abfd, addr);
-
- DOIT (x);
- bfd_put_16 (abfd, (bfd_vma) x, addr);
- }
- break;
-
- case 2:
- {
- long x = bfd_get_32 (abfd, addr);
-
- DOIT (x);
- bfd_put_32 (abfd, (bfd_vma) x, addr);
- }
- break;
+ long x = bfd_get_32 (abfd, addr);
- default:
- abort ();
+ DOIT (x);
+ bfd_put_32 (abfd, (bfd_vma) x, addr);
}
- }
+ break;
+
+ default:
+ abort ();
+ }
+ }
/* Now let bfd_perform_relocation finish everything up. */
return bfd_reloc_continue;
--- ../binutils-2.26.orig/gas/config/tc-ia64.c 2016-02-09 15:01:12.086641332 +0000
+++ gas/config/tc-ia64.c 2016-02-09 15:30:18.562003661 +0000
@@ -4360,7 +4360,8 @@ dot_prologue (int dummy ATTRIBUTE_UNUSED
as_warn (_("Pointless use of zero first operand to .prologue"));
else
mask = e.X_add_number;
- n = popcount (mask);
+
+ n = popcount (mask);
if (sep == ',')
parse_operand_and_eval (&e, 0);

View File

@ -556,58 +556,6 @@ diff -rup binutils-2.26.orig/bfd/section.c binutils-2.26/bfd/section.c
.{* Pointer to the common section. *}
.#define bfd_com_section_ptr (&_bfd_std_section[0])
.{* Pointer to the undefined section. *}
diff -rup binutils-2.26.orig/binutils/objcopy.c binutils-2.26/binutils/objcopy.c
--- binutils-2.26.orig/binutils/objcopy.c 2016-02-19 09:35:36.287000943 +0000
+++ binutils-2.26/binutils/objcopy.c 2016-02-19 09:35:54.908106537 +0000
@@ -1108,30 +1108,6 @@ is_specified_symbol (const char *name, h
return htab_find (htab, name) != NULL;
}
-/* Return a pointer to the symbol used as a signature for GROUP. */
-
-static asymbol *
-group_signature (asection *group)
-{
- bfd *abfd = group->owner;
- Elf_Internal_Shdr *ghdr;
-
- if (bfd_get_flavour (abfd) != bfd_target_elf_flavour)
- return NULL;
-
- ghdr = &elf_section_data (group)->this_hdr;
- if (ghdr->sh_link < elf_numsections (abfd))
- {
- const struct elf_backend_data *bed = get_elf_backend_data (abfd);
- Elf_Internal_Shdr *symhdr = elf_elfsections (abfd) [ghdr->sh_link];
-
- if (symhdr->sh_type == SHT_SYMTAB
- && ghdr->sh_info < symhdr->sh_size / bed->s->sizeof_sym)
- return isympp[ghdr->sh_info - 1];
- }
- return NULL;
-}
-
/* Return TRUE if the section is a DWO section. */
static bfd_boolean
@@ -1237,7 +1213,7 @@ is_strip_section (bfd *abfd ATTRIBUTE_UN
/* PR binutils/3181
If we are going to strip the group signature symbol, then
strip the group section too. */
- gsym = group_signature (sec);
+ gsym = bfd_group_signature (sec, isympp);
if (gsym != NULL)
gname = gsym->name;
else
@@ -3091,7 +3067,7 @@ setup_section (bfd *ibfd, sec_ptr isecti
if ((isection->flags & SEC_GROUP) != 0)
{
- asymbol *gsym = group_signature (isection);
+ asymbol *gsym = bfd_group_signature (isection, isympp);
if (gsym != NULL)
{
diff -rup binutils-2.26.orig/binutils/readelf.c binutils-2.26/binutils/readelf.c
--- binutils-2.26.orig/binutils/readelf.c 2016-02-19 09:35:36.295000988 +0000
+++ binutils-2.26/binutils/readelf.c 2016-02-19 09:35:54.911106554 +0000
@ -724,8 +672,9 @@ diff -rup binutils-2.26.orig/ld/emultempl/armelf.em binutils-2.26/ld/emultempl/a
if (thumb_entry_symbol)
{
@@ -730,4 +730,4 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=
@@ -730,5 +730,5 @@ LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=
LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
LDEMUL_SET_SYMBOLS=gld"${EMULATION_NAME}"_set_symbols
# Call the extra arm-elf function
-LDEMUL_FINISH=gld${EMULATION_NAME}_finish
@ -998,17 +947,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
#ifndef offsetof
#define offsetof(TYPE, MEMBER) ((size_t) & (((TYPE*) 0)->MEMBER))
#endif
@@ -68,6 +72,9 @@ static lang_statement_list_type *stat_sa
static lang_statement_list_type **stat_save_ptr = &stat_save[0];
static struct unique_sections *unique_section_list;
static struct asneeded_minfo *asneeded_list_head;
+static cmdline_list_type cmdline_object_only_file_list;
+static cmdline_list_type cmdline_object_only_archive_list;
+static cmdline_list_type cmdline_temp_object_only_list;
/* Forward declarations. */
static void exp_init_os (etree_type *);
@@ -86,6 +93,10 @@ static void lang_do_version_exports_sect
@@ -86,6 +93,13 @@ static void lang_do_version_exports_sect
static void lang_finalize_version_expr_head
(struct bfd_elf_version_expr_head *);
static void lang_do_memory_regions (void);
@ -1016,6 +955,9 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+static void cmdline_get_object_only_input_files (void);
+static void print_cmdline_list (cmdline_union_type *);
+static bfd_boolean cmdline_on_object_only_archive_list_p (bfd *);
+static cmdline_list_type cmdline_object_only_file_list;
+static cmdline_list_type cmdline_object_only_archive_list;
+static cmdline_list_type cmdline_temp_object_only_list;
/* Exported variables. */
const char *output_target;
@ -1052,7 +994,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
subsbfd = member;
if (!(*link_info.callbacks
->add_archive_element) (&link_info, member,
@@ -6780,7 +6800,38 @@ lang_process (void)
@@ -6780,10 +6800,41 @@ lang_process (void)
open_input_bfds (statement_list.head, OPEN_BFD_RESCAN);
}
}
@ -1089,9 +1031,12 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ }
+ }
/* Make sure that nobody has tried to add a symbol to this list
before now. */
ASSERT (link_info.gc_sym_list == NULL);
link_info.gc_sym_list = &entry_symbol;
if (entry_symbol.name == NULL)
@@ -8275,3 +8326,965 @@ lang_print_memory_usage (void)
@@ -8275,3 +8326,968 @@ lang_print_memory_usage (void)
printf (" %6.2f%%\n", percent);
}
}
@ -1170,7 +1115,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ bfd *archive, *obfd, *oarchive;
+ ufile_ptr origin = abfd->origin;
+
+ archive = bfd_my_archive (abfd);
+ archive = abfd->my_archive;
+ for (c = cmdline_object_only_archive_list.head; c != NULL; c = next)
+ {
+ if (c->header.type != cmdline_is_bfd_enum)
@ -1178,7 +1123,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+
+ next = c->header.next;
+ obfd = c->abfd.abfd;
+ oarchive = bfd_my_archive (obfd);
+ oarchive = obfd->my_archive;
+
+ /* The list is grouped by archive file name and sorted by member
+ origin. */
@ -1215,7 +1160,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ abort ();
+ case cmdline_is_bfd_enum:
+ abfd = (bfd *) data;
+ archive = bfd_my_archive (abfd);
+ archive = abfd->my_archive;
+ if (archive)
+ break;
+ case cmdline_is_file_enum:
@ -1248,7 +1193,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ next = c->header.next;
+
+ obfd = c->abfd.abfd;
+ oarchive = bfd_my_archive (obfd);
+ oarchive = abfd->my_archive;
+
+ if (strcmp (archive->filename, oarchive->filename) == 0)
+ {
@ -1281,7 +1226,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ break;
+ }
+
+ narchive = bfd_my_archive (nbfd);
+ narchive = nbfd->my_archive;
+ if (strcmp (archive->filename, narchive->filename) != 0)
+ {
+ /* Insert it befor NEXT. */
@ -1338,7 +1283,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ break;
+ case cmdline_is_bfd_enum:
+ abfd = c->abfd.abfd;
+ if (bfd_my_archive (abfd))
+ if (abfd->my_archive)
+ abort ();
+ lang_add_input_file (abfd->filename,
+ lang_input_file_is_file_enum, NULL);
@ -1354,7 +1299,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ next = c->header.next;
+
+ abfd = c->abfd.abfd;
+ archive = bfd_my_archive (abfd);
+ archive = abfd->my_archive;
+
+ /* Add the first archive of the archive member group. */
+ lang_add_input_file (archive->filename,
@ -1373,7 +1318,7 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ if (!next)
+ break;
+ nbfd = next->abfd.abfd;
+ narchive = bfd_my_archive (nbfd);
+ narchive = nbfd->my_archive;
+ }
+ while (strcmp (archive->filename, narchive->filename) == 0);
+ }
@ -1813,7 +1758,10 @@ diff -rup binutils-2.26.orig/ld/ldlang.c binutils-2.26/ld/ldlang.c
+ if (obfd)
+ bfd_close (obfd);
+ if (ofilename)
+ unlink (ofilename);
+ {
+ unlink (ofilename);
+ free (ofilename);
+ }
+ einfo (_("%P%F: failed to add object-only section: %s\n"), err);
+}
+
@ -2069,10 +2017,13 @@ diff -rup binutils-2.26.orig/ld/ldlang.h binutils-2.26/ld/ldlang.h
extern void lang_finish
(void);
extern lang_memory_region_type * lang_memory_region_lookup
@@ -693,4 +693,45 @@ lang_ld_feature (char *);
@@ -693,7 +693,48 @@ lang_ld_feature (char *);
extern void
lang_print_memory_usage (void);
extern void
lang_add_gc_name (const char *);
+typedef enum
+{
+ cmdline_is_file_enum,
@ -2196,7 +2147,7 @@ diff -rup binutils-2.26.orig/ld/ldmain.c binutils-2.26/ld/ldmain.c
/* Even if we're producing relocatable output, some non-fatal errors should
@@ -465,6 +441,8 @@ main (int argc, char **argv)
if (! bfd_close (link_info.output_bfd))
if (!bfd_close (link_info.output_bfd))
einfo (_("%F%B: final close failed: %E\n"), link_info.output_bfd);
+ link_info.output_bfd = NULL;
@ -2318,7 +2269,7 @@ diff -rup binutils-2.26.orig/ld/plugin.c binutils-2.26/ld/plugin.c
+
/* Discard the real file's BFD and substitute the dummy one. */
/* BFD archive handling caches elements so we can't call
/* We can't call bfd_close on archives. BFD archive handling
@@ -1227,14 +1233,17 @@ plugin_call_cleanup (void)
{
if (curplug->cleanup_handler && !curplug->cleanup_done)

View File

@ -1,46 +0,0 @@
--- binutils-2.26.orig/bfd/elf32-i386.c 2016-03-18 10:04:17.245507884 +0000
+++ binutils-2.26/bfd/elf32-i386.c 2016-03-18 10:05:59.336070167 +0000
@@ -1830,7 +1830,8 @@ do_size:
&& (sec->flags & SEC_ALLOC) != 0
&& (r_type != R_386_PC32
|| (h != NULL
- && (! SYMBOLIC_BIND (info, h)
+ && (! (bfd_link_pie (info)
+ || SYMBOLIC_BIND (info, h))
|| h->root.type == bfd_link_hash_defweak
|| !h->def_regular))))
|| (ELIMINATE_COPY_RELOCS
@@ -4287,8 +4288,8 @@ r_386_got32:
else if (h != NULL
&& h->dynindx != -1
&& (r_type == R_386_PC32
- || !bfd_link_pic (info)
- || !SYMBOLIC_BIND (info, h)
+ || !(bfd_link_executable (info)
+ || SYMBOLIC_BIND (info, h))
|| !h->def_regular))
outrel.r_info = ELF32_R_INFO (h->dynindx, r_type);
else
--- binutils-2.26.orig/bfd/elf64-x86-64.c 2016-03-18 10:04:17.244507878 +0000
+++ binutils-2.26/bfd/elf64-x86-64.c 2016-03-18 10:06:46.686331624 +0000
@@ -2029,7 +2029,8 @@ do_size:
&& (sec->flags & SEC_ALLOC) != 0
&& (! IS_X86_64_PCREL_TYPE (r_type)
|| (h != NULL
- && (! SYMBOLIC_BIND (info, h)
+ && (! (bfd_link_pie (info)
+ || SYMBOLIC_BIND (info, h))
|| h->root.type == bfd_link_hash_defweak
|| !h->def_regular))))
|| (ELIMINATE_COPY_RELOCS
@@ -4631,8 +4632,8 @@ direct:
else if (h != NULL
&& h->dynindx != -1
&& (IS_X86_64_PCREL_TYPE (r_type)
- || ! bfd_link_pic (info)
- || ! SYMBOLIC_BIND (info, h)
+ || !(bfd_link_executable (info)
+ || SYMBOLIC_BIND (info, h))
|| ! h->def_regular))
{
outrel.r_info = htab->r_info (h->dynindx, r_type);

View File

@ -1,22 +0,0 @@
--- binutils-2.26.orig/bfd/elflink.c 2016-02-26 13:21:54.134859610 +0000
+++ binutils-2.26/bfd/elflink.c 2016-02-26 13:22:49.083168157 +0000
@@ -555,6 +555,19 @@ bfd_elf_record_link_assignment (bfd *out
if (h == NULL)
return provide;
+ if (h->versioned == unknown)
+ {
+ /* Set versioned if symbol version is unknown. */
+ char *version = strrchr (name, ELF_VER_CHR);
+ if (version)
+ {
+ if (version > name && version[-1] != ELF_VER_CHR)
+ h->versioned = versioned_hidden;
+ else
+ h->versioned = versioned;
+ }
+ }
+
switch (h->root.type)
{
case bfd_link_hash_defined:

View File

@ -18,11 +18,13 @@
%define enable_deterministic_archives 0
# BZ 1342618: Enable support for GCC LTO compilation.
%define enable_lto 1
# Disable the default generation of compressed debug sections.
%define default_compress_debug 0
Summary: A GNU collection of binary utilities
Name: %{?cross}binutils%{?_with_debug:-debug}
Version: 2.26
Release: 23%{?dist}
Version: 2.27
Release: 1%{?dist}
License: GPLv3+
Group: Development/Tools
URL: http://sources.redhat.com/binutils
@ -40,33 +42,21 @@ Patch02: binutils-2.20.51.0.10-ppc64-pie.patch
Patch03: binutils-2.20.51.0.2-ia64-lib64.patch
Patch04: binutils-2.25-version.patch
Patch05: binutils-2.25-set-long-long.patch
# Patch06: binutils-2.20.51.0.10-copy-osabi.patch
Patch07: binutils-2.20.51.0.10-sec-merge-emit.patch
Patch06: binutils-2.20.51.0.10-sec-merge-emit.patch
# Enable -zrelro by default: BZ #621983
Patch08: binutils-2.22.52.0.1-relro-on-by-default.patch
Patch07: binutils-2.22.52.0.1-relro-on-by-default.patch
# Local patch - export demangle.h with the binutils-devel rpm.
Patch09: binutils-2.22.52.0.1-export-demangle.h.patch
Patch08: binutils-2.22.52.0.1-export-demangle.h.patch
# Disable checks that config.h has been included before system headers. BZ #845084
Patch10: binutils-2.22.52.0.4-no-config-h-check.patch
Patch09: binutils-2.22.52.0.4-no-config-h-check.patch
# Fix addr2line to use the dynamic symbol table if it could not find any ordinary symbols.
Patch11: binutils-2.23.52.0.1-addr2line-dynsymtab.patch
Patch10: binutils-2.23.52.0.1-addr2line-dynsymtab.patch
# Fix detections little endian PPC shared libraries
Patch12: binutils-2.24-ldforcele.patch
Patch13: binutils-2.25.1-cleansweep.patch
Patch14: binutils-2.26-formatting.patch
Patch15: binutils-2.26-fix-compile-warnings.patch
# Enable -Bsymbolic and -Bsymbolic-functions to PIE
Patch16: binutils-2.26-Bsymbolic_PIE.patch
Patch11: binutils-2.24-ldforcele.patch
Patch12: binutils-2.25.1-cleansweep.patch
Patch13: binutils-2.26-fix-compile-warnings.patch
# Import H.J.Lu's Kernel LTO patch.
Patch17: binutils-2.26-lto.patch
# Import fix for PR 19698
Patch18: binutils-rh1312151.patch
# Import fix for PR 19601
Patch19: binutils-2.26-fix-GOT-offset-calculation.patch
# Import fix for PR 19579
Patch20: binutils-2.26-common-definitions.patch
# Import fix for PR 19827
Patch21: binutils-2.26-x86-PIE-relocations.patch
Patch14: binutils-2.26-lto.patch
Provides: bundled(libiberty)
@ -112,8 +102,8 @@ Obsoletes: gnupro <= 1117-1
%endif
# The higher of these two numbers determines the default ld.
%{!?ld_bfd_priority: %define ld_bfd_priority 50}
%{!?ld_gold_priority:%define ld_gold_priority 30}
%{!?ld_bfd_priority: %global ld_bfd_priority 50}
%{!?ld_gold_priority:%global ld_gold_priority 30}
%if "%{build_gold}" == "both"
Requires(post): coreutils
@ -176,26 +166,20 @@ using libelf instead of BFD.
%endif
%patch04 -p1 -b .version~
%patch05 -p1 -b .set-long-long~
# %patch06 -p1 -b .copy-osabi~
%patch07 -p1 -b .sec-merge-emit~
%patch06 -p1 -b .sec-merge-emit~
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
%patch08 -p1 -b .relro~
%patch07 -p1 -b .relro~
%endif
%patch09 -p1 -b .export-demangle-h~
%patch10 -p1 -b .no-config-h-check~
%patch11 -p1 -b .addr2line~
%patch08 -p1 -b .export-demangle-h~
%patch09 -p1 -b .no-config-h-check~
%patch10 -p1 -b .addr2line~
%ifarch ppc64le
%patch12 -p1 -b .ldforcele~
%patch11 -p1 -b .ldforcele~
%endif
%patch13 -p0
%patch14 -p0
%patch15 -p1
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch12 -p0
%patch13 -p1
%patch14 -p1
# We cannot run autotools as there is an exact requirement of autoconf-2.59.
@ -297,6 +281,11 @@ CFLAGS="$CFLAGS -O0 -ggdb2 -Wno-error -D_FORTIFY_SOURCE=0"
%endif
%if %{enable_lto}
--enable-lto \
%endif
%if %{default_compress_debug}
--enable-compressed-debug=all \
%else
--enable-compressed-debug=none \
%endif
$CARGS \
--enable-plugins \
@ -519,6 +508,15 @@ exit 0
%endif # %{isnative}
%changelog
* Wed Aug 03 2016 Nick Clifton <nickc@redhat.com> 2.27-1
- Rebase on FSF binutils 2.27 release.
- Retire: binutils-2.26-formatting.patch
- Retire: binutils-2.26-Bsymbolic_PIE.patch
- Retire: binutils-rh1312151.patch
- Retire: binutils-2.26-fix-GOT-offset-calculation.patch
- Retire: binutils-2.26-common-definitions.patch
- Retire: binutils-2.26-x86-PIE-relocations.patch
* Mon Jun 13 2016 Nick Clifton <nickc@redhat.com> 2.26-23
- Enable support for GCC's LTO.
(#1342618)

View File

@ -1 +1 @@
64146a0faa3b411ba774f47d41de239f binutils-2.26.tar.bz2
2869c9bf3e60ee97c74ac2a6bf4e9d68 binutils-2.27.tar.bz2