summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-04-16 22:08:00 -0400
committerRuss Cox <rsc@golang.org>2014-04-16 22:08:00 -0400
commit70d330b5a3db8ce56983c1d36a0f43ce86857e8b (patch)
tree24ea8b9b79aa10066f27cbeb2bd35589f008289f /include
parent95c14bf6ef96625767e5625841207c8d2d6f6d8a (diff)
downloadgo-70d330b5a3db8ce56983c1d36a0f43ce86857e8b.tar.gz
liblink, cmd/ld: reenable nosplit checking and test
The new code is adapted from the Go 1.2 nosplit code, but it does not have the bug reported in issue 7623: g% go run nosplit.go g% go1.2 run nosplit.go BUG rejected incorrectly: main 0 call f; f 120 linker output: # _/tmp/go-test-nosplit021064539 main.main: nosplit stack overflow 120 guaranteed after split check in main.main 112 on entry to main.f -8 after main.f uses 120 g% Fixes issue 6931. Fixes issue 7623. LGTM=iant R=golang-codereviews, iant, ality CC=golang-codereviews, r https://codereview.appspot.com/88190043
Diffstat (limited to 'include')
-rw-r--r--include/link.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/link.h b/include/link.h
index a80b62084..044849254 100644
--- a/include/link.h
+++ b/include/link.h
@@ -124,6 +124,8 @@ struct LSym
short type;
short version;
uchar dupok;
+ uchar external;
+ uchar nosplit;
uchar reachable;
uchar cgoexport;
uchar special;
@@ -229,7 +231,9 @@ enum
{
R_ADDR = 1,
R_SIZE,
- R_CALL,
+ R_CALL, // relocation for direct PC-relative call
+ R_CALLARM, // relocation for ARM direct call
+ R_CALLIND, // marker for indirect call (no actual relocating necessary)
R_CONST,
R_PCREL,
R_TLS,
@@ -313,19 +317,20 @@ struct Pcln
};
// Pcdata iterator.
-// for(pciterinit(&it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) }
+// for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) }
struct Pciter
{
Pcdata d;
uchar *p;
uint32 pc;
uint32 nextpc;
+ uint32 pcscale;
int32 value;
int start;
int done;
};
-void pciterinit(Pciter*, Pcdata*);
+void pciterinit(Link*, Pciter*, Pcdata*);
void pciternext(Pciter*);
// symbol version, incremented each time a file is loaded.