ld.bfd 2.37 SEGV. x86_64 EFI app.

Christian Melki christian.melki@t2data.com
Wed Nov 17 13:38:34 GMT 2021


Hi.

Tried linking a 64-bit EFI app (U-Boot) which results in a SEGV in
ld.bfd (binutils 2.37):

  Program received signal SIGSEGV, Segmentation fault.
0x00005555555d1a8f in elf_x86_64_finish_dynamic_sections
(output_bfd=0x5555557fefa0, info=0x5555557fa140 <link_info>) at
/src/binutils/bfd/elf64-x86-64.c:4676
4676		->this_hdr.sh_entsize = htab->plt.plt_entry_size;
(gdb) bt
#0  0x00005555555d1a8f in elf_x86_64_finish_dynamic_sections
(output_bfd=0x5555557fefa0, info=0x5555557fa140 <link_info>) at
/src/binutils/bfd/elf64-x86-64.c:4676
#1  0x00005555556093ec in bfd_elf_final_link (abfd=<optimized out>,
info=<optimized out>) at /src/binutils/bfd/elflink.c:13116
#2  0x00005555555a4dd6 in ldwrite () at /src/binutils/ld/ldwrite.c:545
#3  0x000055555558c8f0 in main (argc=<optimized out>, argv=<optimized
out>) at /src/binutils/ld/ldmain.c:513

(gdb) p (struct bfd_elf_section_data
*)(htab->elf.splt->output_section)->used_by_bfd
$3 = (struct bfd_elf_section_data *) 0x0

This happens with earlier toolchains and ld.bfd versions too.

Found elf_i386_fake_section handling the COFF reloc object but no
similar function for x86_64. Am I missing something here? I tried adding 
a fake section handling for x86_64, but that didn't help. Any hints on 
why it chokes like this?

Regards,
Christian


More information about the Binutils mailing list