From 4e731e62c4bafe7c54b237072e2216cb1e36693d Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 30 Aug 1999 03:57:47 +0000 Subject: [PATCH] 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. --- sys/sys/cdefs.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index f062c772da7..9bd86dca514 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -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)