SHA256
1
0
forked from pool/binutils
binutils/binutils-skip-rpaths.patch

126 lines
3.4 KiB
Diff
Raw Normal View History

diff --git a/ld/emultempl/elf.em b/ld/emultempl/elf.em
index 42c552b36e..dd0a6b1e60 100644
--- a/ld/emultempl/elf.em
+++ b/ld/emultempl/elf.em
@@ -135,6 +135,8 @@ if test x"$LDEMUL_BEFORE_ALLOCATION" != xgld"$EMULATION_NAME"_before_allocation;
if test x"${ELF_INTERPRETER_NAME}" = x; then
ELF_INTERPRETER_NAME=NULL
fi
+
+ libpath_nl=`echo ${NATIVE_LIB_DIRS// /\\\n}`
fragment <<EOF
/* This is called after the sections have been attached to output
diff --git a/ld/ldelf.c b/ld/ldelf.c
index 2e27cf48a8..7162d0cf91 100644
--- a/ld/ldelf.c
+++ b/ld/ldelf.c
@@ -1506,6 +1506,31 @@ ldelf_append_to_separated_string (char **to, char *op_arg)
}
}
+static int
+ldelf_is_contained (const char *path, const char *dc)
+{
+ while (*dc)
+ {
+ const char *pc = path;
+
+ while (*dc && *pc && *dc == *pc && *dc != '\n'
+ && *pc != ':' && *dc != '=')
+ {
+ dc++;
+ pc++;
+ }
+ if ((*pc == 0 || *pc == ':') && (*dc == '\n' || *dc == '=' || *dc == 0))
+ return 1;
+
+ while (*dc && *dc != '\n')
+ dc++;
+ if (*dc == '\n')
+ dc++;
+ }
+
+ return 0;
+}
+
/* This is called after the sections have been attached to output
sections, but before any sizes or addresses have been set. */
@@ -1513,7 +1538,7 @@ void
ldelf_before_allocation (char *audit, char *depaudit,
const char *default_interpreter_name)
{
- const char *rpath;
+ char *rpath;
asection *sinterp;
bfd *abfd;
Accepting request 671129 from home:marxin:branches:devel:gcc - Update to binutils 2.32: * The binutils now support for the C-SKY processor series. * The x86 assembler now supports a -mvexwig=[0|1] option to control encoding of VEX.W-ignored (WIG) VEX instructions. It also has a new -mx86-used-note=[yes|no] option to generate (or not) x86 GNU property notes. * The MIPS assembler now supports the Loongson EXTensions R2 (EXT2), the Loongson EXTensions (EXT) instructions, the Loongson Content Address Memory (CAM) ASE and the Loongson MultiMedia extensions Instructions (MMI) ASE. * The addr2line, c++filt, nm and objdump tools now have a default limit on the maximum amount of recursion that is allowed whilst demangling strings. This limit can be disabled if necessary. * Objdump's --disassemble option can now take a parameter, specifying the starting symbol for disassembly. Disassembly will continue from this symbol up to the next symbol or the end of the function. * The BFD linker will now report property change in linker map file when merging GNU properties. * The BFD linker's -t option now doesn't report members within archives, unless -t is given twice. This makes it more useful when generating a list of files that should be packaged for a linker bug report. * The GOLD linker has improved warning messages for relocations that refer to discarded sections. - Remove binutils-2.31-branch.diff.gz, fix-pr23919-[123].diff, gold-depend-on-opcodes.diff and s390-relro.diff. - Refresh binutils-skip-rpaths.patch, s390-biarch.diff, cross-avr-size.patch and binutils-revert-plt32-in-branches.diff. - Update to binutils 2.32: * The binutils now support for the C-SKY processor series. * The x86 assembler now supports a -mvexwig=[0|1] option to control encoding of VEX.W-ignored (WIG) VEX instructions. It also has a new -mx86-used-note=[yes|no] option to generate (or not) x86 GNU property notes. * The MIPS assembler now supports the Loongson EXTensions R2 (EXT2), the Loongson EXTensions (EXT) instructions, the Loongson Content Address Memory (CAM) ASE and the Loongson MultiMedia extensions Instructions (MMI) ASE. * The addr2line, c++filt, nm and objdump tools now have a default limit on the maximum amount of recursion that is allowed whilst demangling strings. This limit can be disabled if necessary. * Objdump's --disassemble option can now take a parameter, specifying the starting symbol for disassembly. Disassembly will continue from this symbol up to the next symbol or the end of the function. * The BFD linker will now report property change in linker map file when merging GNU properties. * The BFD linker's -t option now doesn't report members within archives, unless -t is given twice. This makes it more useful when generating a list of files that should be packaged for a linker bug report. * The GOLD linker has improved warning messages for relocations that refer to discarded sections. - Remove binutils-2.31-branch.diff.gz, fix-pr23919-[123].diff, gold-depend-on-opcodes.diff and s390-relro.diff. - Refresh binutils-skip-rpaths.patch, s390-biarch.diff, cross-avr-size.patch and binutils-revert-plt32-in-branches.diff. OBS-URL: https://build.opensuse.org/request/show/671129 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=294
2019-02-04 15:23:14 +01:00
struct bfd_link_hash_entry *ehdr_start = NULL;
Accepting request 953949 from home:marxin:branches:devel:gcc - Update to binutils 2.38: * elfedit: Add --output-abiversion option to update ABIVERSION. * Add support for the LoongArch instruction set. * Tools which display symbols or strings (readelf, strings, nm, objdump) have a new command line option which controls how unicode characters are handled. By default they are treated as normal for the tool. Using --unicode=locale will display them according to the current locale. Using --unicode=hex will display them as hex byte values, whilst --unicode=escape will display them as escape sequences. In addition using --unicode=highlight will display them as unicode escape sequences highlighted in red (if supported by the output device). * readelf -r dumps RELR relative relocations now. * Support for efi-app-aarch64, efi-rtdrv-aarch64 and efi-bsdrv-aarch64 has been added to objcopy in order to enable UEFI development using binutils. * ar: Add --thin for creating thin archives. -T is a deprecated alias without diagnostics. In many ar implementations -T has a different meaning, as specified by X/Open System Interface. * Add support for AArch64 system registers that were missing in previous releases. * Add support for the LoongArch instruction set. * Add a command-line option, -muse-unaligned-vector-move, for x86 target to encode aligned vector move as unaligned vector move. * Add support for Cortex-R52+ for Arm. * Add support for Cortex-A510, Cortex-A710, Cortex-X2 for AArch64. * Add support for Cortex-A710 for Arm. * Add support for Scalable Matrix Extension (SME) for AArch64. * The --multibyte-handling=[allow|warn|warn-sym-only] option tells the assembler what to when it encoutners multibyte characters in the input. The default is to allow them. Setting the option to "warn" will generate a warning message whenever any multibyte character is encountered. Using the There are no new CVEs fixed in the release. OBS-URL: https://build.opensuse.org/request/show/953949 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=387
2022-02-14 16:11:29 +01:00
@@ -1572,7 +1597,65 @@ ldelf_before_allocation (char *audit, char *depaudit,
by dynamic linking. */
rpath = command_line.rpath;
if (rpath == NULL)
- rpath = (const char *) getenv ("LD_RUN_PATH");
+ rpath = getenv ("LD_RUN_PATH");
+
+ if (rpath != NULL && getenv ("SUSE_IGNORED_RPATHS"))
+ {
+ char *dirs = 0;
+ FILE *ldso = fopen (getenv ("SUSE_IGNORED_RPATHS"), "r");
+ if (ldso)
+ {
+ off_t endcur = 0;
+ fseek (ldso, 0, SEEK_END);
+ endcur = ftell (ldso);
+ fseek (ldso, 0, SEEK_SET);
Accepting request 953949 from home:marxin:branches:devel:gcc - Update to binutils 2.38: * elfedit: Add --output-abiversion option to update ABIVERSION. * Add support for the LoongArch instruction set. * Tools which display symbols or strings (readelf, strings, nm, objdump) have a new command line option which controls how unicode characters are handled. By default they are treated as normal for the tool. Using --unicode=locale will display them according to the current locale. Using --unicode=hex will display them as hex byte values, whilst --unicode=escape will display them as escape sequences. In addition using --unicode=highlight will display them as unicode escape sequences highlighted in red (if supported by the output device). * readelf -r dumps RELR relative relocations now. * Support for efi-app-aarch64, efi-rtdrv-aarch64 and efi-bsdrv-aarch64 has been added to objcopy in order to enable UEFI development using binutils. * ar: Add --thin for creating thin archives. -T is a deprecated alias without diagnostics. In many ar implementations -T has a different meaning, as specified by X/Open System Interface. * Add support for AArch64 system registers that were missing in previous releases. * Add support for the LoongArch instruction set. * Add a command-line option, -muse-unaligned-vector-move, for x86 target to encode aligned vector move as unaligned vector move. * Add support for Cortex-R52+ for Arm. * Add support for Cortex-A510, Cortex-A710, Cortex-X2 for AArch64. * Add support for Cortex-A710 for Arm. * Add support for Scalable Matrix Extension (SME) for AArch64. * The --multibyte-handling=[allow|warn|warn-sym-only] option tells the assembler what to when it encoutners multibyte characters in the input. The default is to allow them. Setting the option to "warn" will generate a warning message whenever any multibyte character is encountered. Using the There are no new CVEs fixed in the release. OBS-URL: https://build.opensuse.org/request/show/953949 OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=387
2022-02-14 16:11:29 +01:00
+ dirs = xmalloc (endcur);
+ if (fread (dirs, 1, endcur, ldso) != (size_t) endcur)
+ {
+ free (dirs);
+ dirs = NULL;
+ }
+ }
+ if (dirs)
+ {
+ char *cr;
+ rpath = xstrdup (rpath);
+ cr = rpath; /* cursor read */
+
+ while (*cr)
+ {
+ if (ldelf_is_contained (cr, dirs)
+ || ldelf_is_contained (cr, "$libpath_nl"))
+ {
+ char *cc = cr, *cw = cr;
+ while (*cc && *cc != ':')
+ cc++;
+ if (*cc == ':')
+ {
+ cc++;
+ for (; *cc; cc++, cw++)
+ *cw = *cc;
+ }
+ else if (cw > rpath)
+ cw[-1] = 0;
+
+ *cw = 0;
+ }
+ else
+ {
+ while (*cr && *cr != ':')
+ cr++;
+ if (*cr == ':')
+ cr++;
+ }
+ }
+ if (*rpath == '\0')
+ {
+ free (rpath);
+ rpath = NULL;
+ }
+ }
+ }
for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)