mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
If using GNUC and ELF, make __IDSTRING() expand into an inline asm
statement to put the rcsid into the .comment section. This allows
the comments (ie:version id's of compiler, headers, source, etc) to be
stripped out with the standard tools (strip/objcopy). SVR4 has a
tool called 'mcs' (manipulate comment section) which allows you to
add/remove/compact strings. Removing duplicate strings helps a lot
if the headers generate them.
Using __attribute__((section(".comment"))) would probably also work,
but that still leaves the RCSID occupying C name space somewhere.
This commit is contained in:
parent
158562983e
commit
4e731e62c4
1 changed files with 4 additions and 0 deletions
|
|
@ -190,7 +190,11 @@
|
|||
#endif /* __ELF__ */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
#if defined(__GNUC__) && defined(__ELF__)
|
||||
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
|
||||
#else
|
||||
#define __IDSTRING(name,string) static const char name[] __unused = string
|
||||
#endif
|
||||
|
||||
#ifndef __RCSID
|
||||
#define __RCSID(s) __IDSTRING(rcsid,s)
|
||||
|
|
|
|||
Loading…
Reference in a new issue