Files
binutils/pr33450.diff
Ana Guerrero 18f7e9754d Accepting request 1312402 from devel:gcc
Lets try for some build results in staging.

- Update to version 2.45:
  * New versioned release of libsframe.so.2
  * s390: tools now support SFrame format 2; recognize "z17" as CPU
    name [bsc#1247105, jsc#IBM-1485]
  * sframe sections are now of ELF section type SHT_GNU_SFRAME.
  * sframe secions generated by the assembler have
    SFRAME_F_FDE_FUNC_START_PCREL set.
  * riscv: Support more extensions: standard: Zicfiss v1.0, Zicfilp v1.0,
    Zcmp v1.0, Zcmt v1.0, Smrnmi v1.0, S[sm]dbltrp v1.0, S[sm]ctr v1.0,
    ssqosid v1.0, ssnpm v1.0, smnpm v1.0, smmpm v1.0, sspm v1.0, supm v1.0,
    sha v1.0, zce v1.0, smcdeleg v1.0, ssccfg v1.0, svvptc v1.0, zilsd v1.0,
    zclsd v1.0, smrnmi v1.0;
    vendor: CORE-V, xcvbitmanip v1.0 and xcvsimd v1.0;
    SiFive, xsfvqmaccdod v1.0, xsfvqmaccqoqv1.0 and xsfvfnrclipxfqf v1.0;
    T-Head: xtheadvdot v1.0;
    MIPS: xmipscbop v1.0, xmipscmov v1.0, xmipsexectl v1.0, xmipslsp v1.0.
  * Support RISC-V privileged version 1.13, profiles 20/22/23, and
    .bfloat16 directive.
  * x86: Add support for these ISAs: Intel Diamond Rapids AMX, MOVRS,
    AVX10.2 (including SM4), MSR_IMM; Zhaoxin PadLock PHE2, RNG2, GMI, XMODX.
    Drop support for  AVX10.2 256 bit rounding.
  * arm: Add support for most of Armv9.6, enabled by -march=armv9.6-a and
    extensions '+cmpbr', '+f8f16mm', '+f8f32mm', '+fprcvt', '+lsfe', '+lsui',
    '+occmo', '+pops', '+sme2p2', '+ssve-aes', '+sve-aes', '+sve-aes2',
    '+sve-bfscale', '+sve-f16f32mm' and '+sve2p2'.
  * Predefined symbols "GAS(version)" and, on non-release builds, "GAS(date)"
    are now being made available.
  * Add .errif and .warnif directives.
  * linker:
    - Add --image-base=<ADDR> option to the ELF linker to behave the same

OBS-URL: https://build.opensuse.org/request/show/1312402
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/binutils?expand=0&rev=182
2025-10-21 09:15:06 +00:00

79 lines
2.3 KiB
Diff

commit aeaaa9af6359c8e394ce9cf24911fec4f4d23703
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Sep 23 08:52:26 2025 +0800
elf: Return error on unsorted symbol table if not allowed
Normally ELF symbol table should be sorted, i.e., local symbols precede
global symbols. Irix 6 is an exception and its elf_bad_symtab is set
to true. Issue an error if elf_bad_symtab is false and symbol table is
unsorted.
PR ld/33450
* elflink.c (set_symbol_value): Change return type to bool and
return false on error. Issue an error on unsorted symbol table
if not allowed.
(elf_link_input_bfd): Return false if set_symbol_value reurns
false.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 66982f82b94..54f0d6e957e 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -9155,7 +9155,7 @@ struct elf_outext_info
<binary-operator> := as in C
<unary-operator> := as in C, plus "0-" for unambiguous negation. */
-static void
+static bool
set_symbol_value (bfd *bfd_with_globals,
Elf_Internal_Sym *isymbuf,
size_t locsymcount,
@@ -9176,9 +9176,15 @@ set_symbol_value (bfd *bfd_with_globals,
"absolute" section and give it a value. */
sym->st_shndx = SHN_ABS;
sym->st_value = val;
- return;
+ return true;
+ }
+ if (!elf_bad_symtab (bfd_with_globals))
+ {
+ _bfd_error_handler (_("%pB: corrupt symbol table"),
+ bfd_with_globals);
+ bfd_set_error (bfd_error_bad_value);
+ return false;
}
- BFD_ASSERT (elf_bad_symtab (bfd_with_globals));
extsymoff = 0;
}
@@ -9188,11 +9194,12 @@ set_symbol_value (bfd *bfd_with_globals,
if (h == NULL)
{
/* FIXMEL What should we do ? */
- return;
+ return false;
}
h->root.type = bfd_link_hash_defined;
h->root.u.def.value = val;
h->root.u.def.section = bfd_abs_section_ptr;
+ return true;
}
static bool
@@ -11890,8 +11897,10 @@ elf_link_input_bfd (struct elf_final_link_info *flinfo, bfd *input_bfd)
return false;
/* Symbol evaluated OK. Update to absolute value. */
- set_symbol_value (input_bfd, isymbuf, locsymcount,
- r_symndx, val);
+ if (!set_symbol_value (input_bfd, isymbuf, locsymcount, r_symndx,
+ val))
+ return false;
+
continue;
}