2011/4/28 Cristian Morales Vega
2011/4/27 Cristian Rodríguez
: El 27/04/11 05:48, Richard Guenther escribió:
On Tue, 26 Apr 2011, Cristian Rodríguez wrote:
El 26/04/11 14:14, Marcus Meissner escribió:
On Tue, Apr 26, 2011 at 02:10:07PM -0300, Cristian Rodríguez wrote:
How does it relate to --as-needed, which we made quite painfully the default already?
That's what Im trying to figure out as well =) not clear to me if it is complementary or mutually exclusive to as-needed.
They are complementary and have similar fallout scenarios.
IMHO, we need both. sure, it may cause some workload, but should be worth it.
If I understood it correctly it's a funny behavior. In the example from Fedora,
gcc -o foo1 foo1.o foo2.so -Wl,--rpath-link=.
without --no-copy-dt-needed-entries would create a perfectly valid binary. foo1 will have a DT_NEEDED entry for foo3.
But if changed to
gcc -shared -o foo1.so foo1.o foo2.so -Wl,--rpath-link=.
the resulting foo1.so library will miss the DT_NEEDED entry for foo3.
So by default DT_NEEDED entries are copied in binaries but no in libraries. So "--no-copy-dt-needed-entries" seems useful for libraries... but it will only make binaries fail to build when they would otherwise be created perfectly correct.
OK I'm sleepy, but I also were when I wrote the other message :-p I'm wrong or --[no-]copy-dt-needed-entries has no effect at all when creating shared libraries? If so, I would be against it. What are we going to win? For shared libraries makes no difference and its only effect is making binaries fail to build! Yes, those binaries could fail to build in the future, but making ALL of them fail to build NOW is not any better. $ readelf -d foo2.so | fgrep NEEDED 0x0000000000000001 (NEEDED) Shared library: [foo3.so] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] $ gcc -o foo1 foo1.o foo2.so -Wl,--rpath-link=. $ readelf -d foo1 | fgrep NEEDED 0x0000000000000001 (NEEDED) Shared library: [foo2.so] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] 0x0000000000000001 (NEEDED) Shared library: [foo3.so] $ gcc -shared -o foo1.so foo1.o foo2.so -Wl,--rpath-link=. $ readelf -d foo1.so | fgrep NEEDED 0x0000000000000001 (NEEDED) Shared library: [foo2.so] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] $ gcc -shared -Wl,--no-copy-dt-needed-entries -o foo1.so foo1.o foo2.so -Wl,--rpath-link=. $ readelf -d foo1.so | fgrep NEEDED 0x0000000000000001 (NEEDED) Shared library: [foo2.so] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] $ gcc -shared -Wl,--copy-dt-needed-entries -o foo1.so foo1.o foo2.so -Wl,--rpath-link=. $ readelf -d foo1.so | fgrep NEEDED 0x0000000000000001 (NEEDED) Shared library: [foo2.so] 0x0000000000000001 (NEEDED) Shared library: [libc.so.6] The binary is correct, links to foo3.so even if it was not specified in the command line. And the shared library always missed the foo3.so DT_NEEDED entry. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org