Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Aug 2006 21:40:21 GMT
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/101590: -O2 optimizing out abi-tag note from executables
Message-ID:  <200608072140.k77LeLdX084884@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/101590; it has been noted by GNATS.

From: Bruce Evans <bde@zeta.org.au>
To: Dan Nelson <dnelson@allantgroup.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org
Subject: Re: bin/101590: -O2 optimizing out abi-tag note from executables
Date: Tue, 8 Aug 2006 07:38:03 +1000 (EST)

 On Mon, 7 Aug 2006, Dan Nelson wrote:
 
 >> Fix:
 >
 > Mark abitag as __used instead of __unused, which will force gcc to
 > leave the symbol in the resulting object file even though it's static
 > and has no references.
 
 "__used" is misspelled "__unused" in several other places.  "__used" is new
 so it is rarely used.  "__unused" had to be used bogusly to prevent warnings
 about things that are used but which the compiler couldn't see are used,
 but now the correct spelling can be used.
 
 "__used" is now defined in <sys/cdefs.h>, but <sys/cdefs.h> doesn't
 actually use it.  E.g., <sys/cdefs.h still uses "__unused" for __IDSTRING(),
 but only in the non-__GNUC__ case which is broken anyway due to related
 bugs (some header files use __aligned(), but __aligned is intentionally
 left undefined to properly break the non-__GNUC__ case).  The usual case
 of __IDSTRING() (and thus __FBSDID()) apparently works because the usedness
 is hidden in an asm statement.
 
 crtbrand.c hard-codes the gccism __attribute((...__[un]used)) instead
 of using the macro __[un]used defined in <sys/cdefs.h>.  This is almost
 correct, since crtbrand.c needs to use more attributes than <sys/cdefs.h>
 can reasonably define.
 
 Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608072140.k77LeLdX084884>