From f6f0ceea17092b683db98401f465d667c3a83347 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 4 Dec 2001 16:44:55 +0000 Subject: [PATCH] PR/14639: Ben Harris: Stick the rcsid's in the data segment via inline assembly, so that we don't get duplicate symbol errors when we have multiple __KERNEL_RCSID's --- sys/sys/cdefs_aout.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/sys/cdefs_aout.h b/sys/sys/cdefs_aout.h index e2ae92c85b82..86aef597b277 100644 --- a/sys/sys/cdefs_aout.h +++ b/sys/sys/cdefs_aout.h @@ -1,4 +1,4 @@ -/* $NetBSD: cdefs_aout.h,v 1.6 2001/11/13 19:52:39 tv Exp $ */ +/* $NetBSD: cdefs_aout.h,v 1.7 2001/12/04 16:44:55 christos Exp $ */ /* * Written by J.T. Conklin 01/17/95. @@ -45,8 +45,11 @@ #define __warn_references(sym,msg) #endif -#define __IDSTRING(name,string) \ - static const char name[] __attribute__((__unused__)) = string +#define __IDSTRING(_n,_s) \ + __asm__(".data ; .asciz \"" _s "\" ; .text") + +#undef __KERNEL_RCSID +#define __KERNEL_RCSID(_n,_s) __IDSTRING(__CONCAT(rcsid,_n),_s) #define __RCSID(_s) __IDSTRING(rcsid,_s) #define __SCCSID(_s) @@ -54,11 +57,11 @@ #define __COPYRIGHT(_s) __IDSTRING(copyright,_s) #if defined(USE_KERNEL_RCSIDS) || !defined(_KERNEL) -#define __KERNEL_RCSID(_n, _s) __IDSTRING(__CONCAT(rcsid,_n),_s) +#define __KERNEL_RCSID(_n,_s) __IDSTRING(__CONCAT(rcsid,_n),_s) #else -#define __KERNEL_RCSID(_n, _s) +#define __KERNEL_RCSID(_n,_s) #endif -#define __KERNEL_SCCSID(_n, _s) +#define __KERNEL_SCCSID(_n,_s) #define __KERNEL_COPYRIGHT(_n, _s) __IDSTRING(__CONCAT(copyright,_n),_s) #endif /* !_SYS_CDEFS_AOUT_H_ */