https://sourceware.org/bugzilla/show_bug.cgi?id=34088

            Bug ID: 34088
           Summary: Input file order isn't kept for linker script files
           Product: binutils
           Version: 2.47 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

From

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124869

ld is called with:

-plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/15/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccHvsBot.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc --build-id
--no-add-needed --hash-style=gnu -m elf_x86_64 -static -o x
/usr/lib/gcc/x86_64-redhat-linux/15/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-redhat-linux/15/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/15/crtbeginT.o
-L/usr/lib/gcc/x86_64-redhat-linux/15
-L/usr/lib/gcc/x86_64-redhat-linux/15/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/15/../../.. -L/lib
-L/usr/lib x.o -lm --start-group -lgcc -lgcc_eh -lc --end-group
/usr/lib/gcc/x86_64-redhat-linux/15/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/15/../../../../lib64/crtn.o

-lm is a linker script:

$ cat /lib64/libm.a
/* GNU ld script
*/
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /usr/lib64/libm-2.42.a /usr/lib64/libmvec.a )
$ 

When LTO is used, ld appends /usr/lib64/libm-2.42.a /usr/lib64/libmvec.a to
the input file list.  As the result, the .eh_frame section terminator in crtn.o
is placed before libm-2.42.a and the .eh_frame section in the output isn't
terminated.  It results in the output crash.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to