Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Aug 2006 07:38:03 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        freebsd-bugs@FreeBSD.org, FreeBSD-gnats-submit@FreeBSD.org
Subject:   Re: bin/101590: -O2 optimizing out abi-tag note from executables
Message-ID:  <20060808071623.F9516@delplex.bde.org>
In-Reply-To: <200608071659.k77GxGTA014220@dan.emsphone.com>
References:  <200608071659.k77GxGTA014220@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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?20060808071623.F9516>