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