开发者

Removal of build info for what command

bash-2.05$ what xxx
ndmpd:
     Product:      yyy
     Release:
     Build number: unknown user-2011-87
     Build date:   Mon Mar 28 20:51:25 2011
     Build arch.:  solaris
     Build info:   unknown host:/xx/yyy/zzz/vv/www,DBG=1,OPT=-O

when I run the what command on our executable (xxx). We don't want the following line to be printed.

Build info: unknown host:/export/home/murugs2/SI/dev,DBG=1,OPT=-O

I dunno how old programmers did this. I want to rem开发者_StackOverflowove this. How to do it? The src file(c++ code ) is compiled using gcc.


These strings correspond to SCCS version information patterns that are found in the target files.

You can strip off the unwanted one by patching you binaries but the simplest way would be to remove it from the source code. It will be easily locatable by looking for the "@(#)" token.

eg:

char sccsid[] = "@(#) Build info:   unknown host:/xx/yyy/zzz/vv/www,DBG=1,OPT=-O";


This is usually stored in the ELF comments section, which can be viewed, deleted, added to, or replaced with the various options to the /usr/ccs/bin/mcs command.


Assuming the compiled binary doesn't use it, there's no reason you can't edit the string away yourself (by changing all the characters to - or something). I don't know of a utility to do it, although strip might help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜