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

--- Comment #2 from Corentin Silva Pereira 
<corentin.silvapere...@4d-virtualiz.com> ---
(In reply to Nick Clifton from comment #1)

Hi Nick,

Just so you can have more context, our software is developped with QT C++, and
we have a lot of .o and .so files to link with the main software of our
solution. One command can link like a 100 files/lib. This is the one that's
causing this crash.

Unfortunately, i can't give you the ld command i use because the code belongs
to my company and i'm not authorized to give it. Although i tried to compile
binutils 2.34 manually and i managed to cause the segfault within GDB.

Here's what i got :

Program received signal SIGSEGV, Segmentation fault.
0x0000555555600b03 in elf_link_add_object_symbols (info=<optimized out>,
abfd=<optimized out>) at elflink.c:5262
5262                  non_ir_ref_dynamic = h->root.non_ir_ref_dynamic;
(gdb) bt
#0  0x0000555555600b03 in elf_link_add_object_symbols (info=<optimized out>,
abfd=<optimized out>) at elflink.c:5262
#1  bfd_elf_link_add_symbols (abfd=<optimized out>, info=<optimized out>) at
elflink.c:5809
#2  0x000055555559c484 in load_symbols (place=<optimized out>,
entry=0x55555580f630) at ldlang.c:3098
#3  load_symbols (entry=0x55555580f630, place=<optimized out>) at ldlang.c:2959
#4  0x000055555559cebf in open_input_bfds (s=0x55555580f630,
mode=mode@entry=OPEN_BFD_NORMAL) at ldlang.c:3568
#5  0x000055555559f518 in lang_process () at ldlang.c:7649
#6  0x00005555555a32a7 in main (argc=225, argv=0x7fffffff9358) at
./ldmain.c:444

I tried to give -g -O0 to all binutils so i can have all the symbols, but i
still can't print h or print h->root within GDB.

> The 2.34 release of the binutils is quite old now.  Are you able to update
> to a newer version ? 
To answer your question, we are porting the software to Ubuntu 24.04 which uses
a more recent version of binutils but i still have the problem on Ubuntu 24.04
so i don't think it is very related to the version.

Are there elements i can add to the binutils compiling arguments to give you
more information ? For example, something to generate a coredump or something
to read those optimized out values

Best regards

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

Reply via email to