Bug 12353 - exception_separate_shared_{12,21}_test fail when built with --as-needed
Summary: exception_separate_shared_{12,21}_test fail when built with --as-needed
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Cary Coutant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-29 03:12 UTC by Allan McRae
Modified: 2016-03-27 17:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Allan McRae 2010-12-29 03:12:37 UTC
When building the gold testsuite with LDFLAGS="-Wl,--as-needed", the following tests fail due to undefined symbols:

FAIL: exception_separate_shared_12_test (exit: 127)
===================================================

./exception_separate_shared_12_test: symbol lookup error: ./exception_shared_1.so: undefined symbol: _Z2f1v

FAIL: exception_separate_shared_21_test (exit: 127)
===================================================

./exception_separate_shared_21_test: symbol lookup error: ./exception_shared_1.so: undefined symbol: _Z2f1v


When built with --as-needed:
 0x00000001 (NEEDED)                     Shared library: [exception_shared_1.so]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

When built without --as-needed:
 0x00000001 (NEEDED)                     Shared library: [exception_shared_1.so]
 0x00000001 (NEEDED)                     Shared library: [exception_shared_2.so]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
Comment 1 Cary Coutant 2016-03-27 17:00:40 UTC
Fixed with this commit:

https://sourceware.org/ml/binutils-cvs/2012-12/msg00083.html