SHA256
6
0
forked from pool/binutils

24 Commits

Author SHA256 Message Date
163294f8d2 Accepting request 1294193 from devel:gcc
Fix a typo and sync with a change from SLFO (adjusted to
continue building gold in Factory)

- pr33029.patch: Fix crash in assembler with -gdwarf-5
- Do not build binutils-gold for SLFO.

OBS-URL: https://build.opensuse.org/request/show/1294193
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=181
2025-07-20 13:27:45 +00:00
f8319038da Fix typo in changes and carry over a change from SLFO to
devel:gcc (but so that gold remains enabled on Factory for now)
- pr33029.patch: Fix crash in assembler with -gdwarf-5

- Do not build binutils-gold for SLFO.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=500
2025-07-17 13:10:39 +00:00
722b5664bd Accepting request 1291682 from devel:gcc
Skip PGO with %want_reproducible_builds (boo#1040589) (forwarded request 1291583 from bmwiedemann)

OBS-URL: https://build.opensuse.org/request/show/1291682
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=180
2025-07-14 08:49:39 +00:00
c68f248d6d Skip PGO with %want_reproducible_builds (boo#1040589)
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=498
2025-07-10 12:16:59 +00:00
a96b8d380f Accepting request 1288676 from devel:gcc
- pr33029.patch: Fix crash in assembler with -gdawrf-5 (forwarded request 1286747 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/1288676
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=179
2025-06-27 21:00:03 +00:00
0ed753250b - pr33029.patch: Fix crash in assembler with -gdawrf-5
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=496
2025-06-26 12:22:29 +00:00
6ea12aba13 Accepting request 1282736 from devel:gcc
- Drop aarch64-common-pagesize.patch, aarch64 no longer uses 64K page size (forwarded request 1282431 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/1282736
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=178
2025-06-05 18:31:34 +00:00
13e049f446 - Drop aarch64-common-pagesize.patch, aarch64 no longer uses 64K page size
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=494
2025-06-04 12:32:38 +00:00
afef41171e Accepting request 1275274 from devel:gcc
- Add -std=gnu17 to move gcc15 forward, as temporary measure until
  the binutils version can be updated [bsc#1241916].

OBS-URL: https://build.opensuse.org/request/show/1275274
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=177
2025-05-08 16:21:41 +00:00
9987aa9839 Can't submit this from non-devel project, so switch the devel:gcc
variant temporarily to this one.

- Add -std=gnu17 to move gcc15 forward, as temporary measure until
  the binutils version can be updated [bsc#1241916].

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=492
2025-05-07 12:32:37 +00:00
f239e244d8 Try again
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=491
2025-03-25 15:13:49 +00:00
f499f1acf5 - binutils-gold is gone for good
- remove support for our unsupported architectures from the enterprise
  codestreams (alpha, avr, pru, epiphany, hppa, ia64, m68k, mips, rx, sh4
  sparc, xtensa)

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=490
2025-03-25 14:36:17 +00:00
66c9b49144 - Update to current 2.44:
* riscv - disassembly now supports -M,max
  * nios2 - support dropped except in readelf
  * assembler:
    - x86: add support for AMX-AVX512, AMX-FP8, AMX-MOVRS, AMX-TF32
      and AMX-TRANSPOSE, MOVRS, PHE2, RNG2, GMI, MSR_IMM instructions
    - x86: add support for Intel AVX10.2 and SM4 AVX10.2 extensions
    - aarch64: SME and SVE non-widening BFloat16 instructions
    - riscv: various standard and vendor extensions added:
      Zicfiss v1.0, Zicfilp v1.0, Zcmp v1.0, Zcmt v1.0,
      Smrnmi v1.0, S[sm]dbltrp v1.0 and S[sm]ctr v1.0;
      CORE-V: xcvbitmanip v1.0 and xcvsimd v1.0;
      SiFive: xsfvqmaccdod v1.0, xsfvqmaccqoqv1.0 and xsfvfnrclipxfqf v1.0
  * linker:
    - loongarch: changed default max page size from 16KiB to 64KiB
    - add support for mixed LTO and non-LTO code in relocatable output
    - add --image-base=<ADDR> to behave like -Ttext-segment for
      compatibility with LLD
    - Accept percent-encoded and %[string] encoded JSON payload
      with --package-metadata
- binutils-gold is gone for good.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=489
2025-03-24 16:30:48 +00:00
0073239164 - Do not build binutils-gold for openSUSE Factory or SLFO.
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=488
2025-02-13 10:20:31 +00:00
4b78165cf7 Accepting request 1237516 from devel:gcc
- Enable multitarget build on loongarch64 (forwarded request 1236850 from jsulig)

OBS-URL: https://build.opensuse.org/request/show/1237516
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=176
2025-01-15 16:42:31 +00:00
872ccfe028 - Enable multitarget build on loongarch64
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=486
2025-01-13 15:24:18 +00:00
0b92143ab3 Accepting request 1235669 from devel:gcc
- Unset SUSE_ZNOW while running testsuite, many tests cannot cope (forwarded request 1231723 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/1235669
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=175
2025-01-09 14:04:09 +00:00
ea6705f235 - Unset SUSE_ZNOW while running testsuite, many tests cannot cope
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=484
2025-01-07 16:15:39 +00:00
1100ed340e Accepting request 1229830 from devel:gcc
This gives us loongarch, new s390 insns (for SLE), and for now
avoid the issue with zstd we had in the last submission (by not
using it by default).  It's also what is going to be in SLE-15
soon.

- Update to current 2.43.1 branch [PED-10254, PED-10306]:
  * s390 - Add arch15 instructions
  * various fixes from upstream: PR32153, PR32171, PR32189,
    PR32196, PR32191, PR32109, PR32372, PR32387
- Adjusted binutils-2.43-branch.diff.gz.
- Disable zstd-by-default again (needs adjustments in at least
  golang,llvm15,llvm17 first)
- Add binutils-fix-branch.diff.
- Check non-changing of flex/bison inputs only after applying
  branch and fix-branch diffs.

- drop ld-relro.diff (relro is the default for some time)
  and it warns on avr spuriously (bsc#1233520)

- Add loongarch64 as new target

- Enable zstd compression algorithm (instead of zlib)
  for debug info sections by default.

OBS-URL: https://build.opensuse.org/request/show/1229830
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=174
2024-12-11 20:01:22 +00:00
37d03cdb94 - Disable zstd-by-default again (needs adjustments in at least
golang,llvm15,llvm17 first)
- Add binutils-fix-branch.diff.
- Check non-changing of flex/bison inputs only after applying
  branch and fix-branch diffs.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=482
2024-12-09 15:54:38 +00:00
89ba785707 - Update to current 2.43.1 branch [PED-10254, PED-10306]:
* s390 - Add arch15 instructions
  * various fixes from upstream: PR32153, PR32171, PR32189,
    PR32196, PR32191, PR32109, PR32372, PR32387
- Adjusted binutils-2.43-branch.diff.gz.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=481
2024-12-09 14:59:58 +00:00
a2d6bc201e - Add loongarch64 as new target
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=480
2024-11-26 10:31:59 +00:00
38e0c73256 - drop ld-relro.diff (relro is the default for some time)
and it warns on avr spuriously (bsc#1233520)

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=479
2024-11-26 10:31:08 +00:00
5b00f2f6a7 Accepting request 1199785 from home:martinliska:branches:devel:gcc
- Enable zstd compression algorithm (instead of zlib)
  for debug info sections by default.

OBS-URL: https://build.opensuse.org/request/show/1199785
OBS-URL: https://build.opensuse.org/package/show/devel:gcc/binutils?expand=0&rev=478
2024-10-14 13:27:39 +00:00
8 changed files with 165 additions and 137 deletions

View File

@@ -16,6 +16,7 @@
<flavor>spu</flavor>
<flavor>avr</flavor>
<flavor>pru</flavor>
<flavor>loongarch64</flavor>
<flavor>mips</flavor>
<flavor>m68k</flavor>
<flavor>epiphany</flavor>

View File

@@ -1,56 +0,0 @@
Change default common-page-size to 64K on aarch64. This enables the use
of RELRO since we are using 64K pages.
Index: binutils-2.41/bfd/elfnn-aarch64.c
===================================================================
--- binutils-2.41.orig/bfd/elfnn-aarch64.c 2023-07-03 01:00:00.000000000 +0200
+++ binutils-2.41/bfd/elfnn-aarch64.c 2023-08-16 16:31:51.238779641 +0200
@@ -10251,7 +10251,7 @@ const struct elf_size_info elfNN_aarch64
#define ELF_ARCH bfd_arch_aarch64
#define ELF_MACHINE_CODE EM_AARCH64
#define ELF_MAXPAGESIZE 0x10000
-#define ELF_COMMONPAGESIZE 0x1000
+#define ELF_COMMONPAGESIZE 0x10000
#define bfd_elfNN_bfd_free_cached_info \
elfNN_aarch64_bfd_free_cached_info
Index: binutils-2.41/gold/aarch64.cc
===================================================================
--- binutils-2.41.orig/gold/aarch64.cc 2023-07-03 01:00:00.000000000 +0200
+++ binutils-2.41/gold/aarch64.cc 2023-08-16 16:28:35.959450565 +0200
@@ -3555,7 +3555,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -3584,7 +3584,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -3613,7 +3613,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx
@@ -3642,7 +3642,7 @@ const Target::Target_info Target_aarch64
"/lib/ld.so.1", // program interpreter
0x400000, // default_text_segment_address
0x10000, // abi_pagesize (overridable by -z max-page-size)
- 0x1000, // common_pagesize (overridable by -z common-page-size)
+ 0x10000, // common_pagesize (overridable by -z common-page-size)
false, // isolate_execinstr
0, // rosegment_gap
elfcpp::SHN_UNDEF, // small_common_shndx

BIN
binutils-2.43-branch.diff.gz (Stored with Git LFS)

Binary file not shown.

22
binutils-fix-branch.diff Normal file
View File

@@ -0,0 +1,22 @@
This is used to manually patch the bison generated files when
the binutils-X.YZ-branch.diff touches them. That diff is generated
directly from git and doesn't contain the generated .c/h files.
The base tarball does contain them, but generated from the unpatched state.
In SLE12 and older we can't regenerate them due to too old versions
of flex and bison.
So, when the branch diff _does_ touch them we need to do the regeneration
via such a manual patch.
Index: binutils-2.43/ld/ldgram.c
===================================================================
--- binutils-2.43.orig/ld/ldgram.c 2024-08-04 01:00:00.000000000 +0200
+++ binutils-2.43/ld/ldgram.c 2024-12-09 16:41:08.089715376 +0100
@@ -2839,7 +2839,7 @@ yyreduce:
case 73: /* ifile_p1: SEARCH_DIR '(' filename ')' */
#line 324 "ldgram.y"
- { ldfile_add_library_path ((yyvsp[-1].name), search_dir_linker_script); }
+ { ldfile_add_library_path ((yyvsp[-1].name), false); }
#line 2844 "ldgram.c"
break;

View File

@@ -1,3 +1,70 @@
-------------------------------------------------------------------
Thu Jul 10 05:26:01 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>
- Skip PGO with %want_reproducible_builds (boo#1040589)
-------------------------------------------------------------------
Wed Jun 18 09:30:37 UTC 2025 - Andreas Schwab <schwab@suse.de>
- pr33029.patch: Fix crash in assembler with -gdwarf-5
-------------------------------------------------------------------
Tue Jun 3 09:07:07 UTC 2025 - Andreas Schwab <schwab@suse.de>
- Drop aarch64-common-pagesize.patch, aarch64 no longer uses 64K page size
-------------------------------------------------------------------
Tue May 6 14:33:48 UTC 2025 - Michael Matz <matz@suse.com>
- Add -std=gnu17 to move gcc15 forward, as temporary measure until
the binutils version can be updated [bsc#1241916].
-------------------------------------------------------------------
Thu Feb 13 09:39:06 UTC 2025 - Richard Biener <rguenther@suse.com>
- Do not build binutils-gold for SLFO.
-------------------------------------------------------------------
Fri Jan 10 08:54:55 UTC 2025 - JS <obs.coke518@passinbox.com>
- Enable multitarget build on loongarch64
-------------------------------------------------------------------
Tue Dec 17 14:09:54 UTC 2024 - Andreas Schwab <schwab@suse.de>
- Unset SUSE_ZNOW while running testsuite, many tests cannot cope
-------------------------------------------------------------------
Mon Dec 9 14:49:46 UTC 2024 - Michael Matz <matz@suse.com>
- Update to current 2.43.1 branch [PED-10254, PED-10306]:
* s390 - Add arch15 instructions
* various fixes from upstream: PR32153, PR32171, PR32189,
PR32196, PR32191, PR32109, PR32372, PR32387
- Adjusted binutils-2.43-branch.diff.gz.
- Disable zstd-by-default again (needs adjustments in at least
golang,llvm15,llvm17 first)
- Add binutils-fix-branch.diff.
- Check non-changing of flex/bison inputs only after applying
branch and fix-branch diffs.
-------------------------------------------------------------------
Wed Nov 20 14:59:28 UTC 2024 - Jiri Slaby <jslaby@suse.cz>
- drop ld-relro.diff (relro is the default for some time)
and it warns on avr spuriously (bsc#1233520)
-------------------------------------------------------------------
Mon Nov 18 18:12:05 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Add loongarch64 as new target
-------------------------------------------------------------------
Tue Sep 10 05:25:27 UTC 2024 - Martin Liška <martin.liska@hey.com>
- Enable zstd compression algorithm (instead of zlib)
for debug info sections by default.
-------------------------------------------------------------------
Wed Aug 28 13:18:28 UTC 2024 - Michael Matz <matz@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package binutils
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -99,12 +99,12 @@ Release: 0
%define make_check_handling false
%endif
# handle all binary object formats supported by SUSE (and a few more)
%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le riscv64 s390 s390x x86_64 %x86_64
%ifarch %ix86 %arm aarch64 ia64 ppc ppc64 ppc64le riscv64 s390 s390x x86_64 %x86_64 loongarch64
%define build_multitarget 1
%else
%define build_multitarget 0
%endif
%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa
%define target_list aarch64 alpha armv5l armv6l armv7l armv8l avr pru epiphany hppa hppa64 i686 ia64 loongarch64 m68k mips powerpc powerpc64 powerpc64le riscv64 rx s390 s390x sh4 sparc sparc64 x86_64 xtensa
%define build_gprofng 0
@@ -132,18 +132,17 @@ Source2: binutils-%{version}.tar.bz2.sig
Source3: binutils.keyring
Source4: baselibs.conf
Patch1: binutils-2.43-branch.diff.gz
Patch2: binutils-fix-branch.diff
Patch3: binutils-skip-rpaths.patch
Patch4: s390-biarch.diff
Patch5: x86-64-biarch.patch
Patch6: unit-at-a-time.patch
Patch8: ld-relro.diff
Patch9: testsuite.diff
Patch10: enable-targets-gold.diff
Patch12: s390-pic-dso.diff
Patch14: binutils-build-as-needed.diff
Patch15: binutils-znow.patch
Patch22: binutils-bfd_h.patch
Patch34: aarch64-common-pagesize.patch
Patch37: binutils-revert-plt32-in-branches.diff
Patch38: binutils-fix-invalid-op-errata.diff
Patch39: binutils-revert-nm-symversion.diff
@@ -153,6 +152,7 @@ Patch42: binutils-compat-old-behaviour.diff
Patch43: binutils-revert-hlasm-insns.diff
Patch44: binutils-revert-rela.diff
Patch60: binutils-disable-code-arch-error.diff
Patch61: pr33029.patch
Patch90: cross-avr-nesc-as.patch
Patch92: cross-avr-omit_section_dynsym.patch
Patch93: cross-avr-size.patch
@@ -178,7 +178,8 @@ Requires: alts
%else
PreReq: update-alternatives
%endif
%if 0%{!?cross:1} && 0%{?suse_version} >= 1310
# We want gold for SLE15 and (newer) openSUSE, but not SLE16
%if 0%{!?cross:1} && 0%{?suse_version} >= 1310 && ( 0%{?suse_version} < 1600 || 0%{?is_opensuse} )
%define gold_archs %ix86 aarch64 %arm x86_64 %x86_64 ppc ppc64 ppc64le s390x %sparc
%endif
@@ -245,26 +246,29 @@ The next generation profiling tool for Linux
echo "make check will return with %{make_check_handling} in case of testsuite failures."
%setup -q -n binutils-%{version}
# Backup flex and biscon files for later verification.
cp ld/ldlex.l ld/ldlex.l.orig
cp ld/ldgram.y ld/ldgram.y.orig
# Patch is outside test_vanilla because it's supposed to be the
# patch bringing the tarball to the newest upstream version
%patch -P 1 -p1
%patch -P 2 -p1
# Backup flex and biscon files for later verification. Do this
# after branch and fix-branch patches are applied (which are assumed
# to manual fixup generated files, in case the branch diff touches
# the flex/bison source files)
cp ld/ldlex.l ld/ldlex.l.orig
cp ld/ldgram.y ld/ldgram.y.orig
%if !%{test_vanilla}
%patch -P 3 -p1
%patch -P 4
%patch -P 5
%patch -P 6
%patch -P 8
%patch -P 9
%patch -P 10
%patch -P 12
%patch -P 14
%patch -P 15
%patch -P 22
%patch -P 34 -p1
%if %{suse_version} < 1550
%patch -P 37 -p1
%endif
@@ -278,6 +282,7 @@ cp ld/ldgram.y ld/ldgram.y.orig
%patch -P 44 -p1
%endif
%patch -P 60 -p1
%patch -P 61 -p1
%if "%{TARGET}" == "avr"
cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h
%patch -P 90
@@ -298,6 +303,14 @@ diff -u ld/ldgram.y ld/ldgram.y.orig
sed -i -e '/BFD_VERSION_DATE/s/$/-%(echo %release | sed 's/\.[0-9]*$//')/' bfd/version.h
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
# gcc15 and up default to c23, these older binutils would need patches
# for that. As an impeding version update fixes that as well, simply
# override the compiler instead of bothering with backports
%if %{suse_version} > 1600
CC="gcc -std=gnu17"
export CC
%endif
%if 0%{!?cross:1}
# Building native binutils
echo "Building native binutils."
@@ -376,7 +389,7 @@ cd build-dir
%endif
--enable-shared \
%if %{suse_version} > 1500
%if %{with bootstrap} && 0%{?do_profiling}
%if %{with bootstrap} && 0%{?do_profiling} && !0%{?want_reproducible_builds}
--enable-pgo-build=lto \
%endif
--enable-colored-disassembly \
@@ -388,8 +401,9 @@ cd build-dir
--enable-warn-execstack=yes \
--enable-warn-rwx-segments=yes
#FIXME: enable in the future
#%if %{suse_version} > 1550
# FIXME: enable in future, when at least llvm15,llvm17,golang are
# fixed to accept zstd
#%if %{suse_version} > 1600
# --enable-default-compressed-debug-sections-algorithm=zstd \
#%endif
@@ -489,7 +503,7 @@ make -C gas-nesc %{?make_output_sync} %{?_smp_mflags}
%endif
%check
unset SUSE_ASNEEDED
unset SUSE_ASNEEDED SUSE_ZNOW
# newer distros set this envvar (e.g. to get deterministic archives by default)
# but of course that breaks tests that precisely are
# designed for checking file replacement in archives based on mtime.

View File

@@ -1,63 +0,0 @@
Index: ld/lexsup.c
===================================================================
--- ld/lexsup.c.orig 2024-08-04 01:00:00.000000000 +0200
+++ ld/lexsup.c 2024-08-06 16:02:35.554864901 +0200
@@ -772,6 +772,9 @@ parse_args (unsigned argc, char **argv)
}
}
+ optarg = "relro";
+ ldemul_handle_option ('z');
+
last_optind = -1;
while (1)
{
Index: ld/testsuite/config/default.exp
===================================================================
--- ld/testsuite/config/default.exp.orig 2024-08-04 01:00:00.000000000 +0200
+++ ld/testsuite/config/default.exp 2024-08-06 16:05:13.860859897 +0200
@@ -39,7 +39,7 @@ if [info exists env(LD_UNDER_TEST)] {
}
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 {
@@ -92,7 +92,7 @@ if {[info exists ld_testsuite_bindir]} {
}
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
@@ -343,7 +343,7 @@ if ![info exists ELFEDIT] then {
}
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 {
Index: ld/testsuite/ld-bootstrap/bootstrap.exp
===================================================================
--- ld/testsuite/ld-bootstrap/bootstrap.exp.orig 2024-08-04 01:00:00.000000000 +0200
+++ ld/testsuite/ld-bootstrap/bootstrap.exp 2024-08-06 16:02:35.554864901 +0200
@@ -112,7 +112,12 @@ foreach flags $test_flags {
# This test can only be run if we have the ld build directory,
# since we need the object files.
- if {[file normalize $ld] != [file normalize $objdir/ld-new]} {
+ set ldexe $ld
+ set ldparm [string first " " $ld]
+ if { $ldparm > 0 } then {
+ set ldexe [string range $ld 0 $ldparm]
+ }
+ if {[file normalize $ldexe] != [file normalize $objdir/ld-new]} {
untested $testname
continue
}

43
pr33029.patch Normal file
View File

@@ -0,0 +1,43 @@
From f601ffb52199a883f16df385b73a14e756b3e19a Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Wed, 28 May 2025 18:20:17 +0930
Subject: [PATCH] PR 33029 segv in dwarf2_finish with --gdwarf-5
Specifying --gdwarf-5 with a source lacking a ".file 0" directive
results in this segfault.
* dwarf2dbg.c (out_debug_str): Use files[1] if files[0] is
empty regardless of dwarf level.
---
gas/dwarf2dbg.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index fd1f96d80c5..a40fe6967d5 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -3019,6 +3019,11 @@ out_debug_str (segT str_seg, symbolS **name_sym, symbolS **comp_dir_sym,
int len;
int first_file = DWARF2_LINE_VERSION > 4 ? 0 : 1;
+ if (files_in_use == 0)
+ abort ();
+ if (first_file == 0 && files[first_file].filename == NULL)
+ first_file = 1;
+
subseg_set (str_seg, 0);
/* DW_AT_name. We don't have the actual file name that was present
@@ -3026,8 +3031,7 @@ out_debug_str (segT str_seg, symbolS **name_sym, symbolS **comp_dir_sym,
We're not supposed to get called unless at least one line number
entry was emitted, so this should always be defined. */
*name_sym = symbol_temp_new_now_octets ();
- if (files_in_use == 0)
- abort ();
+
if (files[first_file].dir)
{
char *dirname = remap_debug_filename (dirs[files[first_file].dir]);
--
2.50.0