bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/21334] [MIPS] Undefined hidden symbols cause assertion failure b


From: hobbitalastair at yandex dot com
Subject: [Bug ld/21334] [MIPS] Undefined hidden symbols cause assertion failure bfd/elfxx-mips.c:3860
Date: Fri, 31 Mar 2017 07:26:16 +0000

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

--- Comment #1 from Alastair Hughes <hobbitalastair at yandex dot com> ---
I believe I have encountered the same issue while attempting to build a MIPS
cross compiler, statically linking against musl libc (2.28.51.20170331 and
2.28). I will attach the objects used during the link.

Here is the collect2 invocation:

$ /pkg/src/gcc-build/gcc/collect2 -plugin
/pkg/src/gcc-build/gcc/liblto_plugin.so
-plugin-opt=/pkg/src/gcc-build/gcc/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccRJho5Z.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc
--sysroot=/sysroot --eh-frame-hdr -EB -dynamic-linker /lib/ld-musl-mips.so.1
-melf32btsmip /sysroot/usr/lib/crt1.o /sysroot/usr/lib/crti.o
/pkg/src/gcc-build/gcc/crtbegin.o -L/pkg/src/gcc-build/gcc
-L/opt/mips-linux-musl/mips-linux-musl/bin
-L/opt/mips-linux-musl/mips-linux-musl/lib -L/sysroot/usr/lib /tmp/cc64Bubr.o
-lgcc -lc -lgcc /pkg/src/gcc-build/gcc/crtend.o /sysroot/usr/lib/crtn.o

Linking succeeds without the crt1.o object, albeit complaining about being
unable to find __start - I'm not sure whether this is significant or not, but
presumably you will be able to tell :)

I played around with the file that the configure script was attempting to
build:

$ cat config.c
int
main ()
{

  ;
  return 0;
}
$ /pkg/src/gcc-build/gcc/xgcc -B/pkg/src/gcc-build/gcc
-B/opt/mips-linux-musl/mips-linux-musl/bin/
-B/opt/mips-linux-musl/mips-linux-musl/lib/ -isystem
/opt/mips-linux-musl/mips-linux-musl/include -isystem
/opt/mips-linux-musl/mips-linux-musl-sys-include -g -O2 -minterlink-mips16
config.c -v
$ /opt/mips-linux-musl/mips-linux-musl/bin/ld -melf32btsmip
/sysroot/usr/lib/crti.o /pkg/src/gcc-build/gcc/crtbegin.o
-L/pkg/src/gcc-build/gcc -L/opt/mips-linux-musl/mips-linux-musl/bin
-L/opt/mips-linux-musl/mips-linux-musl/lib -L/sysroot/usr/lib config.o -lgcc
-lc -lgcc /pkg/src/gcc-build/gcc/crtend.o /sysroot/usr/lib/crtn.o
/opt/mips-linux-musl/mips-linux-musl/bin/ld: BFD (GNU Binutils)
2.28.51.20170331 assertion fail /pkg/src/binutils-gdb/bfd/elfxx-mips.c:3860
$ readelf --syms config.o
Symbol table '.symtab' contains 20 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS config.c
     2: 00000000     0 SECTION LOCAL  DEFAULT    1 
     3: 00000000     0 SECTION LOCAL  DEFAULT    2 
     4: 00000000     0 SECTION LOCAL  DEFAULT    3 
     5: 00000000     0 SECTION LOCAL  DEFAULT    8 
     6: 00000000     0 SECTION LOCAL  DEFAULT    9 
     7: 00000000     0 SECTION LOCAL  DEFAULT   10 
     8: 00000000     0 SECTION LOCAL  DEFAULT   12 
     9: 00000000     0 SECTION LOCAL  DEFAULT   13 
    10: 00000000     0 SECTION LOCAL  DEFAULT   15 
    11: 00000000     0 SECTION LOCAL  DEFAULT   17 
    12: 00000000     0 SECTION LOCAL  DEFAULT   19 
    13: 00000000     0 SECTION LOCAL  DEFAULT   21 
    14: 00000000     0 SECTION LOCAL  DEFAULT    4 
    15: 00000000     0 SECTION LOCAL  DEFAULT    5 
    16: 00000000     0 SECTION LOCAL  DEFAULT    6 
    17: 00000000     0 SECTION LOCAL  DEFAULT   20 
    18: 00000000     0 SECTION LOCAL  DEFAULT   23 
    19: 00000000     8 FUNC    GLOBAL DEFAULT    9 main

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]