FS#77365 - [binutils] ldconfig: /usr/lib/libbfd.so is not an ELF file - it has the wrong magic bytes at the sta
Attached to Project:
Community Packages
Opened by Andreas Baumann (andreas_baumann) - Friday, 03 February 2023, 07:05 GMT
Last edited by freswa (frederik) - Friday, 03 February 2023, 12:44 GMT
Opened by Andreas Baumann (andreas_baumann) - Friday, 03 February 2023, 07:05 GMT
Last edited by freswa (frederik) - Friday, 03 February 2023, 12:44 GMT
|
Details
Description:
with: shared linking to these files outside binutils rm -f "$pkgdir"/usr/lib/lib{bfd,opcodes}.so echo 'INPUT( /usr/lib/libbfd.a -lsframe -liberty -lz -lzstd -ldl )' > "$pkgdir/usr/lib/libbfd.so" echo 'INPUT( /usr/lib/libopcodes.a -lbfd )' > "$pkgdir/usr/lib/libopcodes.so" you will get: ldconfig: /usr/lib/libbfd.so is not an ELF file - it has the wrong magic bytes at the start. Looking at ldconfig.c I see: elf_header = (ElfW(Ehdr) *) file_contents; if (memcmp (elf_header->e_ident, ELFMAG, SELFMAG) != 0) { /* The file is neither ELF nor aout. Check if it's a linker script, like libc.so - otherwise complain. Only search the beginning of the file. */ size_t len = MIN (statbuf.st_size, 512); if (memmem (file_contents, len, "GROUP", 5) == NULL && memmem (file_contents, len, "GNU ld script", 13) == NULL && !is_gdb_python_file (file_name)) error (0, 0, _("%s is not an ELF file - it has the wrong magic bytes at the start.\n"), file_name); ret = 1; } So probably libbfd.so should have a "GNU ld script" header to make this ELF detection in ldconfig.c happy: /* GNU ld script */ https://github.com/archlinux/svntogit-packages/blob/packages/binutils/trunk/PKGBUILD#L113 Funnily /usr/lib/libopcodes.so is not showing this behaviour. |
This task depends upon
Closed by freswa (frederik)
Friday, 03 February 2023, 12:44 GMT
Reason for closing: Fixed
Additional comments about closing: Committed revision 468145
Will be in the next release (with glibc 2.37)
Friday, 03 February 2023, 12:44 GMT
Reason for closing: Fixed
Additional comments about closing: Committed revision 468145
Will be in the next release (with glibc 2.37)
https://src.fedoraproject.org/rpms/binutils/blob/rawhide/f/binutils.spec#_995
https://src.fedoraproject.org/rpms/binutils/c/d83e8ebe37d0c12fc10e10e2d8ff4abeed6f734c