Subject: Re: empty undefined symbols
To: None <tech-toolchain@NetBSD.org>
From: Valeriy E. Ushakov <firstname.lastname@example.org>
Date: 10/22/2007 06:18:07
On Mon, Oct 22, 2007 at 03:40:49 +0200, Martin Husemann wrote:
> We need to declare global register usage (outside usual abi restrictions)
> on sparc64 with
> .register %g2,#scratch
> .register %g3,#scratch
> (and we do this in the kernel quite a lot).
> However, this seems to create "empty" undefined symbols:
> # nm /netbsd |fgrep " U "
> Using #ignore instead of #scratch makes those Us go away.
> This is a binutils bug, isn't it?
No, for .register you get STT_SPARC_REGISTER entries in the symbol
table and for #scratch you get symbol with null name, see psABI.
You can use readelf instead of nm to confirm this.
The #ignore form of the .register pseudo-instruction is used only
for code that does not change the global registers in a program
visible way, such as thread and context switching system code.
For kernel I think #ignore is ok (presumably we refer to those
registers either to save restore context or we refer to alternate
email@example.com | Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/ | Ist zu Grunde gehen