Commit 8ec9ffc7 authored by Andrew Gerrand's avatar Andrew Gerrand

6l: move mapped symbol table lower in memory

Allows binary to run on some Linux system.

Fix for issue 365.

R=rsc
CC=golang-dev
https://golang.org/cl/199096
parent 36cd49e3
......@@ -68,7 +68,7 @@ asmb(void)
int np;
vlong va, fo, w, symo;
int strtabsize;
vlong symdatva = 0x99LL<<24;
vlong symdatva = SYMDATVA;
Optab *o;
strtabsize = 0;
......
......@@ -439,7 +439,7 @@ asmb(void)
int a, dynsym;
uchar *op1;
vlong vl, va, startva, fo, w, symo, elfsymo, elfstro, elfsymsize, machlink;
vlong symdatva = 0x99LL<<32;
vlong symdatva = SYMDATVA;
ElfEhdr *eh;
ElfPhdr *ph, *pph;
ElfShdr *sh;
......
......@@ -28,6 +28,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// This magic number also defined in src/pkg/runtime/symtab.c in SYMCOUNTS
#define SYMDATVA 0x99LL<<24
typedef struct Library Library;
struct Library
{
......
......@@ -18,13 +18,8 @@
// TODO(rsc): Move this *under* the text segment.
// Then define names for these addresses instead of hard-coding magic ones.
#ifdef _64BIT
#define SYMCOUNTS ((int32*)(0x99LL<<32)) // known to 6l
#define SYMDATA ((byte*)(0x99LL<<32) + 8)
#else
#define SYMCOUNTS ((int32*)(0x99LL<<24)) // known to 8l
#define SYMCOUNTS ((int32*)(0x99LL<<24)) // known to 6l, 8l; see src/cmd/ld/lib.h
#define SYMDATA ((byte*)(0x99LL<<24) + 8)
#endif
typedef struct Sym Sym;
struct Sym
......
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