1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:50:24 -07:00

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
This commit is contained in:
Russ Cox 2014-08-12 17:41:16 -04:00
parent 0c6146711c
commit 9abf0b6e9f
2 changed files with 8 additions and 8 deletions

View File

@ -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;

View File

@ -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);