Results 1 to 3 of 3

Thread: G++ - option to don't register system/compiler data in binary.

  1. #1
    Join Date
    Jan 2008
    Beans
    184

    [SOLVED] C++ - remove registered system/compiler data in binary.

    Hello there.

    I'm compiling a simple command-line program, and i don't want to register the compiler version and other unused data in the binary.

    I just know i did it before, but i forgot the compiler params/options .

    You know... if you open (not run) the binary it's possible to find a bunch of lines like "GCC: (Ubuntu 4.3.3-5ubuntu4) 4.3.3", and some other references...

    BTW... i tried to pack it using upx but it returns me an error (NotCompressibleException).

    Thanks in advance.

    PS: If someone also knows how to do this using the Netbeans IDE please lemme know!
    Last edited by Repgahroll; October 9th, 2009 at 06:22 PM.

  2. #2
    Join Date
    May 2008
    Beans
    Hidden!

    Re: G++ - option to don't register system/compiler data in binary.

    The strip utility can remove them, or you can use the -fno-ident option, however the latter method will still include the strings from other libraries.

    Code:
    strip -R .comment <program>
    http://www.trilithium.com/johan/2004...ident-strings/

  3. #3
    Join Date
    Jan 2008
    Beans
    184

    Re: G++ - option to don't register system/compiler data in binary.

    Thank you very much!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •