bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/14533] large (88M) ICC compiled .obj files inside .a archive c


From: bsergean at gmail dot com
Subject: [Bug gold/14533] large (88M) ICC compiled .obj files inside .a archive confuse / error the gold linker
Date: Fri, 31 Aug 2012 17:14:34 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14533

--- Comment #2 from Benjamin Sergeant <bsergean at gmail dot com> 2012-08-31 
17:14:34 UTC ---
1) If I strip the .obj file the error seems to go away.

2) Here's the error.

/tmp/gold-dev/bin/ld: libsomething.a(AnObjectFile.o): invalid string offset
25281974 >= 48 for section `.shstrtab'
/tmp/gold-dev/bin/ld: libsomething.a(AnObjectFile.o): invalid string offset 79
>= 48 for section `(null)'
/tmp/gold-dev/bin/ld: libsomething.a(AnObjectFile.o): invalid string offset
25281974 >= 48 for section `.shstrtab'
/tmp/gold-dev/bin/ld: libsomething.a(AnObjectFile.o): invalid string offset 79
>= 48 for section `(null)'
libsomething.a: member libsomething.a(AnObjectFile.o) in archive is not an
object
~                                                                               
What's funny is that I don't get that last error "is not an object" if I try to 
make a shared lib from just that object.

So maybe there's something weird with how (1) we create the .a (ranlib) or with
how gold parse the .a.

Here's what readelf says about that symbol.

ELF Header:
  Magic:   7f 45 4c 46 02 01 01 03 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - Linux
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          0 (bytes into file)
  Start of section headers:          85864776 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           0 (bytes)
  Number of program headers:         0
  Size of section headers:           64 (bytes)
  Number of section headers:         0 (92838)
  Section header string table index: 65535 (66722)


If I tries to make a shared lib from that object file, here's what I get

/tmp$ /tmp/gold-dev/bin/ld.gold -shared -o /tmp/caca.so AnObjectFile.o |& head
/tmp/gold-dev/bin/ld.gold: error: AnObjectFile.o: section name section has
wrong type: 4
/tmp/gold-dev/bin/ld.gold: error: AnObjectFile.o: symbol table name section has
wrong type: 4
/tmp/gold-dev/bin/ld.gold: error: AnObjectFile.o: bad section name offset for
section 1: 79
/tmp/gold-dev/bin/ld.gold: error: AnObjectFile.o: extended index for symbol
70238 out of range: 92838
/tmp/gold-dev/bin/ld.gold: error: AnObjectFile.o: extended index for symbol
70239 out of range: 92839
/tmp/gold-dev/bin/ld.gold: error: AnObjectFile.o: extended index for symbol
70240 out of range: 92840
/tmp/gold-dev/bin/ld.gold: error: AnObjectFile.o: extended index for symbol
70241 out of range: 92841


How can I help further with troubleshooting that ?
Can I add some debugging option to the linker ?
Can I extract just a piece of that .obj file, or obfuscate it so I can
upload / attach it to Bugzilla ?

Thanks !!

ps:
I haven't done any serious benchmark yet on the impact of linking with gold but
on a large lib that we have (330M), linking with gold was 2.5x faster (5s to
2s), and we have many of those libs.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- 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]