aboutsummaryrefslogtreecommitdiff
path: root/src/liblink/objfile.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2015-01-29 14:58:54 -0500
committerRuss Cox <rsc@golang.org>2015-02-03 18:22:15 +0000
commit77a415e5a698e8f897aed8aa64db6855b8f952fc (patch)
treea2adb923b983adfd5301f0d87c9c26949e22d9d6 /src/liblink/objfile.c
parent72521319c733e5de62bb837508ea9fa2b1f3a0a2 (diff)
downloadgo-77a415e5a698e8f897aed8aa64db6855b8f952fc.tar.xz
liblink: place TEXT/GLOBL flags in p->from3 always
Before, amd64 and 386 stored the flags in p->from.scale and arm and ppc64 stored the flags in p->reg. Both caused special cases in printing and in handling of the addresses. To avoid possible conflicts with the real meaning of p->from and to avoid storing a non-register value in a reg field, use from3 to hold a TYPE_CONST value giving the flags. There is still a special case for printing, because the flags are specified without a $, and normally a TYPE_CONST prints with a $. But that's much less special than what came before. This allows us to remove the textflag and settextflag methods from LinkArch. They are no longer architecture-specific. Change-Id: I931da8e1ecd92e127cd9aa44ef5a73c42e730110 Reviewed-on: https://go-review.googlesource.com/3572 Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/liblink/objfile.c')
-rw-r--r--src/liblink/objfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liblink/objfile.c b/src/liblink/objfile.c
index bdd63ccb64..79a88db0bf 100644
--- a/src/liblink/objfile.c
+++ b/src/liblink/objfile.c
@@ -189,7 +189,7 @@ writeobj(Link *ctxt, Biobuf *b)
s->size = p->to.offset;
if(s->type == 0 || s->type == SXREF)
s->type = SBSS;
- flag = ctxt->arch->textflag(p);
+ flag = p->from3.offset;
if(flag & DUPOK)
s->dupok = 1;
if(flag & RODATA)
@@ -222,7 +222,7 @@ writeobj(Link *ctxt, Biobuf *b)
else
etext->next = s;
etext = s;
- flag = ctxt->arch->textflag(p);
+ flag = p->from3.offset;
if(flag & DUPOK)
s->dupok = 1;
if(flag & NOSPLIT)