Closed
Bug 664366
Opened 14 years ago
Closed 14 years ago
elfhack fails with "PT_GNU_RELRO segment doesn't start on a section start"
Categories
(Firefox Build System :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla7
People
(Reporter: jruderman, Assigned: glandium)
References
Details
Attachments
(1 file)
2.24 KB,
patch
|
khuey
:
review+
|
Details | Diff | Splinter Review |
With Ubuntu 11.04 (g++ 4.5.2 and GNU ld 2.21.0.20110327), I get this error when I try to compile Firefox:
c++ -fno-rtti -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -Wno-long-long -fno-strict-aliasing -std=gnu++0x -pthread -pipe -fexceptions -DDEBUG -D_DEBUG -DTRACING -g -fPIC -shared -Wl,-z,defs -Wl,-h,test.so -o test.so test.o
===
=== 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/jruderman/mozilla-central/objdir-ff-debug/build/unix/elfhack/elfhack -b test.so
test.so: terminate called after throwing an instance of 'std::runtime_error'
what(): PT_GNU_RELRO segment doesn't start on a section start
make[7]: *** [test.so] Aborted
Reporter | ||
Comment 1•14 years ago
|
||
<glandium> it's an obvious bug in ld, the PT_GNU_RELRO segment doesn't even start on a page start
<glandium> iow, it's not page aligned
Reporter | ||
Comment 2•14 years ago
|
||
Two-part workaround:
1. export LDFLAGS="-Wl,-z,norelro"
2. modify build/unix/elfhack/Makefile.in
>ifndef CROSS_COMPILE
> test$(DLL_SUFFIX): test.$(OBJ_SUFFIX) elfhack $(CSRCS:.c=.$(OBJ_SUFFIX))
>- $(MKSHLIB) $<
>+ $(MKSHLIB) $(LDFLAGS) $<
> @echo ===
> @echo === If you get failures below, please file a bug describing the error
Reporter | ||
Comment 4•14 years ago
|
||
Easier workaround:
ac_add_options --disable-elf-hack
Assignee | ||
Comment 5•14 years ago
|
||
For the record, there are actually two problems in ld: the first one is the one I mentioned on irc, and pasted in comment 1, and the second one is that the RELRO segment starts on the .tbss section, instead of .init_array.
However, there still is an inconsistency in how elfhack treats this, because depending on the size of the .tbss section, the behaviour is not the same despite the section layout being similar.
(Note that this only happen when building with -Wl,-z,relro, which is the default on some distributions, which is why -Wl,-z,norelro is a workaround ; using gold instead of ld might work, too)
Blocks: 661800
Comment 6•14 years ago
|
||
Trunk links fine for me with gold on Ubuntu 11.04 x64.
Assignee | ||
Comment 7•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #539962 -
Flags: review?(khuey)
Attachment #539962 -
Flags: review?(khuey) → review+
Assignee | ||
Comment 9•14 years ago
|
||
Assignee: nobody → mh+mozilla
Whiteboard: [inbound]
Comment 10•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla7
Comment 11•14 years ago
|
||
(In reply to comment #9)
> http://hg.mozilla.org/integration/mozilla-inbound/rev/c669354b4930
just to be clear , I have to use --disable-elf-hack every time i compile firefox on my system?
this bug is marked fixed but why am i still getting that error(i did hg pull and compiled today 7/2/11) ?
Assignee | ||
Comment 12•14 years ago
|
||
(In reply to comment #11)
> (In reply to comment #9)
> > http://hg.mozilla.org/integration/mozilla-inbound/rev/c669354b4930
>
> just to be clear , I have to use --disable-elf-hack every time i compile
> firefox on my system?
>
> this bug is marked fixed but why am i still getting that error(i did hg
> pull and compiled today 7/2/11) ?
Does you tree really contain that changeset?
If it does, check the configure output for "whether linker creates PT_GNU_RELRO segments"
Updated•7 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•