diff options
| author | Russ Cox <rsc@golang.org> | 2010-09-19 22:10:34 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2010-09-19 22:10:34 -0400 |
| commit | af12feb8d514b5970c984be61b07c56e0e72b2ce (patch) | |
| tree | c18b5c9b0cabfd8ba2cf0abb12f73bfbf8c4d96b /src/cmd/ld/lib.h | |
| parent | afbee9d87d1ce9fd98e1beb9ac8945263c1f3e52 (diff) | |
| download | go-af12feb8d514b5970c984be61b07c56e0e72b2ce.tar.xz | |
6l, 8l: clean up ELF code, fix NaCl
R=r
CC=golang-dev
https://golang.org/cl/2221042
Diffstat (limited to 'src/cmd/ld/lib.h')
| -rw-r--r-- | src/cmd/ld/lib.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/cmd/ld/lib.h b/src/cmd/ld/lib.h index 501b6a2cbc..092161e14b 100644 --- a/src/cmd/ld/lib.h +++ b/src/cmd/ld/lib.h @@ -40,6 +40,34 @@ struct Library char *pkg; // import path }; +// Terrible but standard terminology. +// A segment describes a block of file to load into memory. +// A section further describes the pieces of that block for +// use in debuggers and such. + +typedef struct Segment Segment; +typedef struct Section Section; + +struct Segment +{ + uchar rwx; // permission as usual unix bits (5 = r-x etc) + uvlong vaddr; // virtual address + uvlong len; // length in memory + uvlong fileoff; // file offset + uvlong filelen; // length on disk + Section* sect; +}; + +struct Section +{ + uchar rwx; + char *name; + uvlong vaddr; + uvlong len; + Section *next; // in segment list + Segment *seg; +}; + extern char symname[]; extern char *libdir[]; extern int nlibdir; @@ -65,8 +93,14 @@ EXTERN char* outfile; EXTERN int32 nsymbol; EXTERN char* thestring; +EXTERN Segment segtext; +EXTERN Segment segdata; +EXTERN Segment segrodata; // NaCl only +EXTERN Segment segsym; + void addlib(char *src, char *obj); void addlibpath(char *srcref, char *objref, char *file, char *pkg); +Section* addsection(Segment*, char*, int); void copyhistfrog(char *buf, int nbuf); void addhist(int32 line, int type); void histtoauto(void); |
