跳过未使用函数的编译 [英] skip compilation of unused functions

查看:117
本文介绍了跳过未使用函数的编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我想编译并静态链接一个程序与dietlibc。

课程,dietlibc包含我的程序永远不需要的功能。

有没有办法将它们从最终的可执行文件中删除?是否有可能会让他们远离饮食信息的源代码?

我正在使用gcc。


Joris

Hello,

I want to compile and link a program statically against the dietlibc. Of
course, the dietlibc includes functions my program never needs. Is
there any way to throw them out of the final executable? Is there maybe
a program that cuts them away from the source code of the dietlibc?
I am using gcc.

Joris

推荐答案

Joris Dolderer< no-spamwrote:
Joris Dolderer <no-spamwrote:

我想编译和将节目静态地连接到dietlibc。

课程,dietlibc包含我的程序永远不需要的功能。

有没有办法将它们从最终的可执行文件中删除?是否有一个程序可以让他们远离吃饭的源代码?

我正在使用gcc。
I want to compile and link a program statically against the dietlibc. Of
course, the dietlibc includes functions my program never needs. Is
there any way to throw them out of the final executable? Is there maybe
a program that cuts them away from the source code of the dietlibc?
I am using gcc.



很抱歉,但这与C(或编译)没有任何关系,但仅仅是

取决于链接器组装的聪明程度来自目标文件和库的最终pro-

克。也许它已经

自动完成你想要的东西,特别是当你做静态

链接时。但是你必须在某个组中询问你使用的链接器的内部工作原理


问候,Jens

-

\ Jens Thoms Toerring ___ jt@toerring.de

\ __________________________ http://toerring.de


" Joris Dolderer" < no-spamwrote in message

news:46 ********************** @ newsspool3.arcor-online.net .. 。
"Joris Dolderer" <no-spamwrote in message
news:46**********************@newsspool3.arcor-online.net...

您好,


我想编译并静态链接一个程序与dietlibc。

课程,dietlibc包含我的程序永远不需要的功能。是否有任何方法可以将它们从最终的可执行文件中删除?是否有一个

程序可以让他们远离吃饭的源代码?

我正在使用gcc。
Hello,

I want to compile and link a program statically against the dietlibc. Of
course, the dietlibc includes functions my program never needs. Is there
any way to throw them out of the final executable? Is there maybe a
program that cuts them away from the source code of the dietlibc?
I am using gcc.



链接在clc上是非主题的。


< OT>

任何体面的,现代链接器将完全按照你的要求进行静态链接。如果你没有,请更换它。 GCC只使用你的b $ b平台的标准链接器,所以你需要询问特定于你平台的

新闻组的详细信息。不确定你的连接器有多聪明

是。

< / OT>


S

-

Stephen Sprunk那些认为他们知道一切的人

CCIE#3723对我们这些人来说是一个很大的烦恼。

K5SSS --Isaac Asimov

-

通过免费的Usenet帐户从 http://www.teranews.com

Linking is off-topic on clc.

<OT>
Any decent, modern linker will do exactly what you ask when statically
linking. If yours doesn''t, replace it. GCC just uses whatever your
platform''s standard linker is, so you''ll need to ask for details on a
newsgroup specific to your platform if you''re not sure how smart your linker
is.
</OT>

S

--
Stephen Sprunk "Those people who think they know everything
CCIE #3723 are a great annoyance to those of us who do."
K5SSS --Isaac Asimov
--
Posted via a free Usenet account from http://www.teranews.com


Stephen Sprunk写道:
Stephen Sprunk wrote:

链接在clc上是偏离主题的。
Linking is off-topic on clc.



哪个是适当的新闻组

用于讨论C标准关于链接的内容?


-

pete

Which is the appropriate newsgroup
for discussing what the C standard says about linking?

--
pete


这篇关于跳过未使用函数的编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆