Commit 9abf0b6e authored by Russ Cox's avatar Russ Cox

cmd/ld: handle large link base addresses

codeblk and datblk were truncating their
arguments to int32. Don't do that.

LGTM=dvyukov, rminnich
R=iant, dvyukov, rminnich
CC=golang-codereviews
https://golang.org/cl/126050043
parent 0c614671
......@@ -425,10 +425,10 @@ dynreloc(void)
}
static void
blk(LSym *start, int32 addr, int32 size)
blk(LSym *start, int64 addr, int64 size)
{
LSym *sym;
int32 eaddr;
int64 eaddr;
uchar *p, *ep;
for(sym = start; sym != nil; sym = sym->next)
......@@ -467,10 +467,10 @@ blk(LSym *start, int32 addr, int32 size)
}
void
codeblk(int32 addr, int32 size)
codeblk(int64 addr, int64 size)
{
LSym *sym;
int32 eaddr, n;
int64 eaddr, n;
uchar *q;
if(debug['a'])
......@@ -527,10 +527,10 @@ codeblk(int32 addr, int32 size)
}
void
datblk(int32 addr, int32 size)
datblk(int64 addr, int64 size)
{
LSym *sym;
int32 i, eaddr;
int64 i, eaddr;
uchar *p, *ep;
char *typ, *rsname;
Reloc *r;
......
......@@ -184,11 +184,11 @@ uint32 be32(uchar *b);
uint64 be64(uchar *b);
void callgraph(void);
void cflush(void);
void codeblk(int32 addr, int32 size);
void codeblk(int64 addr, int64 size);
vlong cpos(void);
void cseek(vlong p);
void cwrite(void *buf, int n);
void datblk(int32 addr, int32 size);
void datblk(int64 addr, int64 size);
int datcmp(LSym *s1, LSym *s2);
vlong datoff(vlong addr);
void deadcode(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment