Commit 6ee91ced authored by Russ Cox's avatar Russ Cox

cmd/pack: rename __.SYMDEF to __.GOSYMDEF

This fixes a problem with ELF tools thinking they know the
format of the symbol table, as we do not use any of the
standard formats for that table.

This change will probably annoy the Plan 9 users, but I
believe there are other incompatibilities already that mean
they have to use a Go-specific nm.

Fixes #3473.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6500117
parent ec9967ff
......@@ -276,7 +276,7 @@ enum as
/*
* this is the ranlib header
*/
#define SYMDEF "__.SYMDEF"
#define SYMDEF "__.GOSYMDEF"
/*
* this is the simulated IEEE floating point
......
......@@ -865,7 +865,7 @@ enum
/*
* this is the ranlib header
*/
#define SYMDEF "__.SYMDEF"
#define SYMDEF "__.GOSYMDEF"
/*
* this is the simulated IEEE floating point
......
......@@ -547,7 +547,7 @@ enum
/*
* this is the ranlib header
*/
#define SYMDEF "__.SYMDEF"
#define SYMDEF "__.GOSYMDEF"
/*
* this is the simulated IEEE floating point
......
......@@ -480,7 +480,7 @@ skiptopkgdef(Biobuf *b)
if(memcmp(p, "!<arch>\n", 8) != 0)
return 0;
/* symbol table is first; skip it */
sz = arsize(b, "__.SYMDEF");
sz = arsize(b, "__.GOSYMDEF");
if(sz < 0)
return 0;
Bseek(b, sz, 1);
......
......@@ -366,7 +366,7 @@ objfile(char *file, char *pkg)
return;
}
/* skip over __.SYMDEF */
/* skip over __.GOSYMDEF */
off = Boffset(f);
if((l = nextar(f, off, &arhdr)) <= 0) {
diag("%s: short read on archive file symbol header", file);
......@@ -402,7 +402,7 @@ objfile(char *file, char *pkg)
* the individual symbols that are unused.
*
* loading every object will also make it possible to
* load foreign objects not referenced by __.SYMDEF.
* load foreign objects not referenced by __.GOSYMDEF.
*/
for(;;) {
l = nextar(f, off, &arhdr);
......
......@@ -43,7 +43,7 @@ enum{
char *errs; /* exit status */
char *filename; /* current file */
char symname[]="__.SYMDEF"; /* table of contents file name */
char symname[]="__.GOSYMDEF"; /* table of contents file name */
int multifile; /* processing multiple files */
int aflag;
int gflag;
......
......@@ -111,7 +111,7 @@ char *opt = "uvnbailogS";
char artemp[] = "/tmp/vXXXXX";
char movtemp[] = "/tmp/v1XXXXX";
char tailtemp[] = "/tmp/v2XXXXX";
char symdef[] = "__.SYMDEF";
char symdef[] = "__.GOSYMDEF";
char pkgdef[] = "__.PKGDEF";
int aflag; /* command line flags */
......
......@@ -52,13 +52,14 @@ func FindGcExportData(r *bufio.Reader) (err error) {
var name string
var size int
// First entry should be __.SYMDEF.
// First entry should be __.GOSYMDEF.
// Older archives used __.SYMDEF, so allow that too.
// Read and discard.
if name, size, err = readGopackHeader(r); err != nil {
return
}
if name != "__.SYMDEF" {
err = errors.New("go archive does not begin with __.SYMDEF")
if name != "__.SYMDEF" && name != "__.GOSYMDEF" {
err = errors.New("go archive does not begin with __.SYMDEF or __.GOSYMDEF")
return
}
const block = 4096
......
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