You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
In "A Manual for the Plan 9 assembler" is this statement: "Setting the 2 bit allows multiple definitions of the same TEXT symbol in a program; the loader will place only one such function in the image."
How does the loader decide which version to use?
Russ Cox
unread,
Jan 10, 2010, 5:50:44 PM1/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Charlie Dorian, golang-nuts
It picks the first one it sees. Tools that use that bit
(called DUPOK) must make sure it doesn't matter which
gets used. This was used in Alef for automatically
generated code fragments that could be shared across
multiple objects.
You're probably looking at this because all the assembly
routines use 7 as their bitmask, but they don't really need to.
Really they should all be using 5 (NOPROF+NOSPLIT) but
somehow the idiom of 7 got established.
Russ
Charles Dorian
unread,
Jan 10, 2010, 5:53:20 PM1/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to r...@golang.org, golang-nuts
In that case, if there are, say, CPU-only versus FPU versions of a function, how does the loader know to use the faster one?
Russ Cox
unread,
Jan 10, 2010, 6:05:08 PM1/10/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Charles Dorian, golang-nuts
On Sun, Jan 10, 2010 at 14:53, Charles Dorian <cldo...@gmail.com> wrote: > In that case, if there are, say, CPU-only versus FPU versions of a function, > how does the loader know to use the faster one?
In that case only one should be included in the archive. In the specific case of math.Sqrt, the Makefile arranges to compile either sqrt.go or sqrt_$(GOARCH).s but not both.