On processors for D ~ decoupling
Thomas Kuehne
thomas-dloop at kuehne.cn
Fri Apr 7 23:18:21 PDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Walter Bright schrieb am 2006-04-08:
> Thomas Kuehne wrote:
>> Walter Bright schrieb am 2006-04-07:
>>> Thomas Kuehne wrote:
>>>> Walter Bright schrieb am 2006-04-06:
>>>>> Although there is a lot of code in std.string, unreferenced free
>>>>> functions in it should be discarded by the linker. A check of the
>>>>> generated .map file should verify this - it is certainly supposed to
>>>>> work that way.
>>>> That's not what is happening on Linux:
>>> Hmm. I tried --gc-symbols, which is supposed to do it, but nothing
>>> happens (even when I try it on C++ files). Can you try --gc-symbols on
>>> your system?
>>
>> doesn't work: --gc-symbols
>> seems to work: --gc-sections
> Right, I typo'd it. However, --gc-sections doesn't work on my system -
> everything is still linked in. But it does on yours - not all of
> std.string is linked in?
Correct
> Also, could you post the full, exact command you used? Perhaps I have
> botched that up, too.
$ dmd a.d -ofx
gcc a.o -o x -lphobos -lpthread -lm -Xlinker -L/opt/dmd/dmd/lib
$ dmd a.d -ofy -L--gc-sections
gcc a.o -o y -lphobos -lpthread -lm -Xlinker -L/opt/dmd/dmd/lib -Xlinker --gc-sections
$ ls -sh1 x y
212K x
136K y
$ objdump -t y | awk "{ print (\$4); }" | grep "6string" | sed 's/\.gnu\.linkonce\.t//' | sort -u
_D3std6string3cmpFAaAaZi
_D3std6string4findFAawZi
_D3std6string6columnFAaiZi
_D3std6string7iswhiteFwZi
_D3std6string8toStringFkZAa
_D3std6string9inPatternFwAaZi
$ gcc --version
gcc (GCC) 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
$ ld --version
GNU ld version 2.16.1
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFEN2Nb3w+/yD4P9tIRArpyAKC0W5zNDTYnugmWjQE5gj09Ww0ZLgCgxsER
jlALdPoz8gHsb2Bw6DWDQ5A=
=8ZHQ
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-announce
mailing list