Bug 12452

Summary: Crash when trying to build Firefox/Seamonkey with Linux Ubuntu 10.10 64-bit
Product: binutils Reporter: Bengt-Erik Soderstrom <bes.wll>
Component: goldAssignee: Ian Lance Taylor <ian>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Bengt-Erik Soderstrom 2011-01-29 15:51:56 UTC
The following happens:

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0b10pre) Gecko/20110121
Firefox/4.0b10pre SeaMonkey/2.1b2pre
Build Identifier: 20110128084136

After the fix for bug 628988 I get this:

==
=== If you get failures below, please file a bug describing the error
=== and your environment (compiler and linker versions), and use
=== --disable-elf-hack until this is fixed.
===
/home/bengt-erik/mozilla-central/src/ff-opt/build/unix/elfhack/elfhack -b
test.so
elfhack: /home/bengt-erik/mozilla-central/src/build/unix/elfhack/elf.cpp:285:
Elf::Elf(std::ifstream&): Assertion `segment->getFileSize() == phdr.p_filesz'
failed.
make[6]: *** [test.so] Avbruten (SIGABRT)
make[6]: *** Tar bort filen "test.so"
make[6]: Lämnar katalogen
"/home/bengt-erik/mozilla-central/src/ff-opt/build/unix/elfhack"
make[5]: *** [libs] Fel 2



Reproducible: Always




Using 64-bit Ubuntu 10.10  (gcc-4.4.real (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5) 
with the Gold Linker (link (GNU coreutils) 8.5.) Disabling elfhack works,
however


And the answer from mozilla is the following:

Mike Hommey [:glandium] 2011-01-28 08:52:17 PST

Could you attach your test.so ?

[reply] [-] Comment 2 Bengt-Erik Soderstrom 2011-01-28 10:12:00 PST

(In reply to comment #1)
> Could you attach your test.so ?

Sorry, I don't now how. test.so gets deleted...Please advice

[reply] [-] Comment 3 Mike Hommey [:glandium] 2011-01-28 10:20:30 PST

(In reply to comment #2)
> (In reply to comment #1)
> > Could you attach your test.so ?
> 
> Sorry, I don't now how. test.so gets deleted...Please advice

Run the gcc command (the one that make displays) by hand.

[reply] [-] Comment 4 Bengt-Erik Soderstrom 2011-01-28 16:40:11 PST

Created attachment 508041 [details]
test.so

OK, attached test.so as requested

[reply] [-] Comment 5 Mike Hommey [:glandium] 2011-01-28 23:49:46 PST

Okay, so this is due to the GNU_RELRO section being weirdly defined. Its end is
not page aligned as it is supposed to be (and elfhack expects it to be), and it
ends in the middle of the .got.plt section.

[reply] [-] Comment 6 Bengt-Erik Soderstrom 2011-01-29 07:36:22 PST

So, for the time being we make it without elfhack (ac_add_options
--disable-elf-hack).


See https://bugzilla.mozilla.org/show_bug.cgi?id=629635
Comment 1 Ian Lance Taylor 2011-01-29 17:54:27 UTC
Which version of gold are you using?  You gave the version number of the coreutils, but that is not the package that gold is in.  What does ld --version report?  There are fixes for this sort of thing in the GNU binutils 2.21 release.
Comment 2 Bengt-Erik Soderstrom 2011-01-30 06:08:26 UTC
It looks like Ubuntu did not supply the latest version, although I installed it only some week ago.. this is what I have:

ld --version
GNU gold (GNU Binutils for Ubuntu 2.20.51-system.20100908) 1.10
Copyright 2010 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
Comment 3 Ian Lance Taylor 2011-01-30 08:01:55 UTC
I'm pretty sure you need at least 20101117 for this to work, and presumably the 2.21 release would be better.

I'll mark this as fixed, but please feel free to reopen this if the problem still occurs with a more recent build.
Comment 4 Bengt-Erik Soderstrom 2011-01-30 17:03:51 UTC
(In reply to comment #3)
> I'm pretty sure you need at least 20101117 for this to work, and presumably the
> 2.21 release would be better.
> 
> I'll mark this as fixed, but please feel free to reopen this if the problem
> still occurs with a more recent build.

After compiling and installing binutils 2.21 I can confirm that it now works OK,
both with ld and with the Gold. Thanks for your help