apply upstream patch to restore options used by syslinux [release 2.26-3mamba;Sat Jun 25 2016]

This commit is contained in:
Silvan Calarco 2024-01-05 20:48:09 +01:00
parent 79b5fb88f5
commit a51d04f30b
3 changed files with 277 additions and 3 deletions

View File

@ -0,0 +1,78 @@
From 202736beb188043bbac7a3b071f5f7a2b7f85dfa Mon Sep 17 00:00:00 2001
From: Cary Coutant <ccoutant@gmail.com>
Date: Thu, 3 Mar 2016 14:13:10 -0800
Subject: [PATCH] Add unused attribute where necessary to quiet GCC 6 warnings.
gold/
PR 19751
* arm.cc (Reloc_stub::Key::name): Add unused attribute.
* dirsearch.cc (Dir_caches::~Dir_caches): Likewise.
---
gold/ChangeLog | 6 ++++++
gold/arm.cc | 2 +-
gold/dirsearch.cc | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/gold/arm.cc b/gold/arm.cc
index ed13c87..c47b002 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -597,7 +597,7 @@ class Reloc_stub : public Stub
// Name of key. This is mainly for debugging.
std::string
- name() const;
+ name() const ATTRIBUTE_UNUSED;
private:
// Stub type.
diff --git a/gold/dirsearch.cc b/gold/dirsearch.cc
index 1b3fefa..6178332 100644
--- a/gold/dirsearch.cc
+++ b/gold/dirsearch.cc
@@ -102,7 +102,7 @@ class Dir_caches
: lock_(), caches_()
{ }
- ~Dir_caches();
+ ~Dir_caches() ATTRIBUTE_UNUSED;
// Add a cache for a directory.
void add(const char*);
--
1.7.1
--- binutils-2.26/gas/config/tc-arm.c.orig 2016-06-25 15:54:41.394303218 +0200
+++ binutils-2.26/gas/config/tc-arm.c 2016-06-25 15:56:36.375225971 +0200
@@ -155,10 +155,10 @@
/* 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 ATTRIBUTE_UNUSED arm_feature_set fpu_arch_vfp_v1 = FPU_ARCH_VFP_V1;
static const arm_feature_set fpu_arch_vfp_v2 = FPU_ARCH_VFP_V2;
-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;
+static const ATTRIBUTE_UNUSED arm_feature_set fpu_arch_vfp_v3 = FPU_ARCH_VFP_V3;
+static const ATTRIBUTE_UNUSED arm_feature_set fpu_arch_neon_v1 = FPU_ARCH_NEON_V1;
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 +210,7 @@
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;
-static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1, -1);
+static const ATTRIBUTE_UNUSED arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1, -1);
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,7 +259,7 @@
ARM_FEATURE_COPROC (FPU_CRYPTO_EXT_ARMV8);
static const arm_feature_set crc_ext_armv8 =
ARM_FEATURE_COPROC (CRC_EXT_ARMV8);
-static const arm_feature_set fpu_neon_ext_v8_1 =
+static const ATTRIBUTE_UNUSED arm_feature_set fpu_neon_ext_v8_1 =
ARM_FEATURE_COPROC (FPU_NEON_EXT_ARMV8 | FPU_NEON_EXT_RDMA);
static int mfloat_abi_opt = -1;

View File

@ -0,0 +1,189 @@
From 1dab972d797c060e17229c2e10da01852ba82629 Mon Sep 17 00:00:00 2001
From: H.J. Lu <hjl.tools@gmail.com>
Date: Thu, 11 Feb 2016 15:31:15 -0800
Subject: [PATCH] Enable -Bsymbolic and -Bsymbolic-functions to PIE
Before binutils 2.26, -Bsymbolic and -Bsymbolic-functions were also
applied to PIE so that "ld -pie -Bsymbolic -E" can be used to export
symbols in PIE with local binding. This patch re-enables -Bsymbolic
and -Bsymbolic-functions for PIE.
Backport from master
PR ld/19615
* ld.texinfo: Document -Bsymbolic and -Bsymbolic-functions for
PIE.
* lexsup.c (parse_args): Enable -Bsymbolic and
-Bsymbolic-functions for PIE.
* testsuite/ld-i386/i386.exp: Run pr19615.
* testsuite/ld-i386/pr19615.d: New file.
* testsuite/ld-i386/pr19615.s: Likewise.
* testsuite/ld-x86-64/pr19615.d: Likewise.
* testsuite/ld-x86-64/pr19615.s: Likewise.
---
ld/ChangeLog | 16 ++++++++++++++++
ld/ld.texinfo | 12 +++++++++---
ld/lexsup.c | 11 +++++------
ld/testsuite/ld-i386/i386.exp | 1 +
ld/testsuite/ld-i386/pr19615.d | 13 +++++++++++++
ld/testsuite/ld-i386/pr19615.s | 13 +++++++++++++
ld/testsuite/ld-x86-64/pr19615.d | 13 +++++++++++++
ld/testsuite/ld-x86-64/pr19615.s | 13 +++++++++++++
ld/testsuite/ld-x86-64/x86-64.exp | 1 +
9 files changed, 84 insertions(+), 9 deletions(-)
create mode 100644 ld/testsuite/ld-i386/pr19615.d
create mode 100644 ld/testsuite/ld-i386/pr19615.s
create mode 100644 ld/testsuite/ld-x86-64/pr19615.d
create mode 100644 ld/testsuite/ld-x86-64/pr19615.s
diff --git a/ld/ld.texinfo b/ld/ld.texinfo
index 1dd7492..2389661 100644
--- a/ld/ld.texinfo
+++ b/ld/ld.texinfo
@@ -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 --git a/ld/lexsup.c b/ld/lexsup.c
index 4cad209..e2fb212 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -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 --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 0e3b310..0cc9645 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -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*"]
diff --git a/ld/testsuite/ld-i386/pr19615.d b/ld/testsuite/ld-i386/pr19615.d
new file mode 100644
index 0000000..86aebd1
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19615.d
@@ -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
+#...
diff --git a/ld/testsuite/ld-i386/pr19615.s b/ld/testsuite/ld-i386/pr19615.s
new file mode 100644
index 0000000..1d85926
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19615.s
@@ -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
diff --git a/ld/testsuite/ld-x86-64/pr19615.d b/ld/testsuite/ld-x86-64/pr19615.d
new file mode 100644
index 0000000..f09bcf3
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr19615.d
@@ -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
+#...
diff --git a/ld/testsuite/ld-x86-64/pr19615.s b/ld/testsuite/ld-x86-64/pr19615.s
new file mode 100644
index 0000000..1d85926
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr19615.s
@@ -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

View File

@ -6,7 +6,7 @@
Name: binutils
Version: 2.26
Release: 2mamba
Release: 3mamba
Summary: GNU Binary Utility Development Utilities
Group: Development/Tools
Vendor: openmamba
@ -23,6 +23,8 @@ Patch5: %{name}-2.22-gcc-4.7-gold-casts.patch
Patch6: %{name}-2.22-build-id.patch
Patch7: %{name}-2.22-gold-fix_pointer_reference.patch
Patch8: binutils-2.23.2-texinfo-5.1.patch
Patch9: binutils-2.26-upstream-syslinux.patch
Patch10: binutils-2.26-gcc-6.1.0.patch
License: GPL
## AUTOBUILDREQ-BEGIN
BuildRequires: bash
@ -95,6 +97,8 @@ Use this package if you need cross platform builds for %{_target_platform} targe
#%patch6 -p0
#%patch7 -p1
#%patch8 -p1
%patch9 -p1
%patch10 -p1
%build
install -d binutils-build
@ -240,7 +244,7 @@ if [ $1 -ge 1 ]; then
%if "%gprof" == "1"
extralang=gprof
%endif
for i in as bfd binutils configure ld standards $extralang; do
for i in as bfd binutils ld $extralang; do
%install_info ${i}.info
done
# remove legacy alternatives
@ -261,7 +265,7 @@ if [ $1 -eq 0 ]; then
%if "%gprof" == "1"
extralang=gprof
%endif
for i in as bfd binutils configure ld standards $extralang; do
for i in as bfd binutils ld $extralang; do
%uninstall_info ${i}.info
done
fi
@ -389,6 +393,9 @@ exit 0
%endif
%changelog
* Sat Jun 25 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 2.26-3mamba
- apply upstream patch to restore options used by syslinux
* Tue Jan 26 2016 Automatic Build System <autodist@mambasoft.it> 2.26-2mamba
- automatic version update by autodist