Bug 49587 - Code generation error with dynamic libraries.
Summary: Code generation error with dynamic libraries.
Status: RESOLVED DUPLICATE of bug 49538
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-30 07:29 UTC by Jarryd Beck
Modified: 2011-07-10 12:20 UTC (History)
0 users

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2011-06-30 09:58:10


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jarryd Beck 2011-06-30 07:29:38 UTC
I have a rather large piece of code (about 20,000 lines) which doesn't appear to be compiled correctly. I can't reproduce the error, but I have found the revision that breaks it, and I can describe roughly what the error is.

The last revision that works is 175340, it is broken in 175341.

Initially the bug surfaced as the instruction pointer trying to execute address 0x0. After further digging (with gdb, running instruction by instruction) I discovered that at a function call, which was in a dynamic library, upon trying to resolve the address of the function, it found that the function was at address zero. It got to the particular function call, went through the dynamic library lookup table, then it dies.
Comment 1 Richard Biener 2011-06-30 09:58:10 UTC
We need a testcase and more information like used compile flags and compiler
version.
Comment 2 Jarryd Beck 2011-06-30 10:16:58 UTC
I wish that I could give you a test case. I can't reproduce it on any small piece of code. The only code that I can get it to break on is my project which has about 20,000 lines of code. It has nearly 100 files and uses boost spirit. It compiles into a library and several executables.

The compiler version I already stated. It's gcc svn, the first broken revision is 175341 (maybe that wasn't clear).

The flags used for compiling are simply -fPIC for the library and nothing extra for the executables.

Another thing to note is that I moved the function call in which the error occurs to later in my code, and a different function bombed in exactly the same way.

How would you like me to proceed?
Comment 3 Jarryd Beck 2011-06-30 11:52:52 UTC
Sorry I better get that function in the dynamic loading correct. It calls the actual function which goes to _dl_runtime_resolve which calls _dl_fixup, then it bombs at the end of _dl_runtime_resolve.
Comment 4 Andrew Pinski 2011-06-30 16:43:08 UTC
Most likely a dup of bug 49538.
Comment 5 Jarryd Beck 2011-06-30 20:56:32 UTC
Ah, yes I think it is.
Comment 6 Jarryd Beck 2011-07-10 12:20:26 UTC
It is definitely a duplicate of bug 49538 which is fixed now, and my problem is fixed. So I am marking this as resolved.

*** This bug has been marked as a duplicate of bug 49538 ***