共享库文件大小
创建共享库时,./sl 文件大小将大于 60KB。 有2个.o文件,总大小超过20KB。
检查实用程序:ldd 和 elfdump 以确定引用的库。 除了使用的原始文件之外,我还看到以下引用:/usr/ccs/lib/pa20_64/lddstub 和 源文件信息:movelr1 PA-RISC 2.0 汇编器。
共享库文件大小增加的可能原因有哪些?
[(C 新手):使用操作系统:HP Unix 11i V2 PA RISC-64]
On creating a shared library the ./sl file size is coming out to be greater than 60KB.
There are 2 .o files whose total size is over 20KB.
Checked the utlities : ldd and elfdump to determine libraries being referenced.
Apart from the original files used I see references of :/usr/ccs/lib/pa20_64/lddstub and
SOURCE FILE INFO: movelr1 PA-RISC 2.0 Assembler.
What are the possible reasons for shared lib file size increase ?.
[(Novice in C) : Working on OS : HP Unix 11i V2 PA RISC-64]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不是 HP-UX 专家,但我最好的猜测是,除了 20kB 的目标文件之外,HP-UX 供应商链接器还在它创建的动态库中添加了一些额外的内容。
您可以使用 strip(1) 实用程序来缩小共享库。
I am not an HP-UX expert but my best guess is that the HP-UX vendor linker is adding some additional stuff to dynamic library it is creating in addition to the 20kB of object files.
You could use the strip(1) utility to make the shared library smaller.
谢谢 Sean!,但是使用 strip 实用程序确实影响了文件大小,〜7KB,但影响很小。
我们发现的另一个选项是: elfdump -dc TestProg.sl
这样做时,我们发现包含系统文件以及源文件的编译日期/时间。 一种可能性是早期版本的 sl 文件包含旧版本的 prog/os 系统文件,这可能是大小差异的可能原因。
共享lib中包含的sys文件:
[mover1.o]:位于路径 /usr/lib/pa20_64/milli.a 中,影响创建的 ./sl 文件的大小。
Thanks Sean!, However using the strip utility did effect the file size, ~7KB , but in a small way.
Another option we found was: elfdump -dc TestProg.sl
On doing that we found that system file is included and also the date/time of compilation of the source files. One probability is that the earlier version of the sl file had older version of prog/os system file included and this could be a possible cause in size difference.
The sys file included in shared lib:
[movelr1.o]: in the path /usr/lib/pa20_64/milli.a influences the size of the ./sl file created.