summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShenghou Ma <minux@golang.org>2014-08-06 00:25:41 -0400
committerShenghou Ma <minux@golang.org>2014-08-06 00:25:41 -0400
commite558263c73379ff1ecd1cc08fa0841ff09fc283f (patch)
tree1c4f7768cb2397815c5808e0b854b9b1c83f9a33 /include
parent3a8b47e3c6f96c701f718c66a1abb2be3a31e0a6 (diff)
downloadgo-e558263c73379ff1ecd1cc08fa0841ff09fc283f.tar.gz
liblink: support big-endian properly
LGTM=rsc R=rsc, iant CC=golang-codereviews https://codereview.appspot.com/115300044
Diffstat (limited to 'include')
-rw-r--r--include/link.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/link.h b/include/link.h
index 7cb04ac12..c5f4841d3 100644
--- a/include/link.h
+++ b/include/link.h
@@ -431,11 +431,17 @@ struct Link
LSym* filesyms;
};
+enum {
+ LittleEndian = 0x04030201,
+ BigEndian = 0x01020304,
+};
+
// LinkArch is the definition of a single architecture.
struct LinkArch
{
char* name; // "arm", "amd64", and so on
int thechar; // '5', '6', and so on
+ int32 endian; // LittleEndian or BigEndian
void (*addstacksplit)(Link*, LSym*);
void (*assemble)(Link*, LSym*);
@@ -560,7 +566,7 @@ int find1(int32 l, int c);
void linkgetline(Link *ctxt, int32 line, LSym **f, int32 *l);
void histtoauto(Link *ctxt);
void mkfwd(LSym*);
-void nuxiinit(void);
+void nuxiinit(LinkArch*);
void savehist(Link *ctxt, int32 line, int32 off);
Prog* copyp(Link*, Prog*);
Prog* appendp(Link*, Prog*);