Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
9040da9e
Commit
9040da9e
authored
Feb 01, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ld: Add -I option to set ELF interpreter.
R=rsc CC=golang-dev
https://golang.org/cl/4080049
parent
eea18d95
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
34 additions
and
8 deletions
+34
-8
asm.c
src/cmd/5l/asm.c
+3
-1
doc.go
src/cmd/5l/doc.go
+2
-0
l.h
src/cmd/5l/l.h
+1
-0
obj.c
src/cmd/5l/obj.c
+4
-1
asm.c
src/cmd/6l/asm.c
+5
-2
doc.go
src/cmd/6l/doc.go
+2
-0
l.h
src/cmd/6l/l.h
+1
-0
obj.c
src/cmd/6l/obj.c
+4
-1
asm.c
src/cmd/8l/asm.c
+5
-2
doc.go
src/cmd/8l/doc.go
+2
-0
l.h
src/cmd/8l/l.h
+1
-0
obj.c
src/cmd/8l/obj.c
+4
-1
No files found.
src/cmd/5l/asm.c
View file @
9040da9e
...
@@ -448,7 +448,9 @@ asmb(void)
...
@@ -448,7 +448,9 @@ asmb(void)
sh
->
type
=
SHT_PROGBITS
;
sh
->
type
=
SHT_PROGBITS
;
sh
->
flags
=
SHF_ALLOC
;
sh
->
flags
=
SHF_ALLOC
;
sh
->
addralign
=
1
;
sh
->
addralign
=
1
;
elfinterp
(
sh
,
startva
,
linuxdynld
);
if
(
interpreter
==
nil
)
interpreter
=
linuxdynld
;
elfinterp
(
sh
,
startva
,
interpreter
);
ph
=
newElfPhdr
();
ph
=
newElfPhdr
();
ph
->
type
=
PT_INTERP
;
ph
->
type
=
PT_INTERP
;
...
...
src/cmd/5l/doc.go
View file @
9040da9e
...
@@ -23,6 +23,8 @@ Options new in this version:
...
@@ -23,6 +23,8 @@ Options new in this version:
-F
-F
Force use of software floating point.
Force use of software floating point.
Also implied by setting GOARM=5 in the environment.
Also implied by setting GOARM=5 in the environment.
-I interpreter
Set the ELF dynamic linker to use.
-L dir1 -L dir2
-L dir1 -L dir2
Search for libraries (package files) in dir1, dir2, etc.
Search for libraries (package files) in dir1, dir2, etc.
The default is the single location $GOROOT/pkg/$GOOS_arm.
The default is the single location $GOROOT/pkg/$GOOS_arm.
...
...
src/cmd/5l/l.h
View file @
9040da9e
...
@@ -332,6 +332,7 @@ EXTERN Oprang thumboprange[ALAST];
...
@@ -332,6 +332,7 @@ EXTERN Oprang thumboprange[ALAST];
EXTERN
char
*
outfile
;
EXTERN
char
*
outfile
;
EXTERN
int32
pc
;
EXTERN
int32
pc
;
EXTERN
uchar
repop
[
ALAST
];
EXTERN
uchar
repop
[
ALAST
];
EXTERN
char
*
interpreter
;
EXTERN
char
*
rpath
;
EXTERN
char
*
rpath
;
EXTERN
uint32
stroffset
;
EXTERN
uint32
stroffset
;
EXTERN
int32
symsize
;
EXTERN
int32
symsize
;
...
...
src/cmd/5l/obj.c
View file @
9040da9e
...
@@ -61,7 +61,7 @@ linkername[] =
...
@@ -61,7 +61,7 @@ linkername[] =
void
void
usage
(
void
)
usage
(
void
)
{
{
fprint
(
2
,
"usage: 5l [-E entry] [-H head] [-L dir] [-T text] [-D data] [-R rnd] [-r path] [-o out] main.5
\n
"
);
fprint
(
2
,
"usage: 5l [-E entry] [-H head] [-
I interpreter] [-
L dir] [-T text] [-D data] [-R rnd] [-r path] [-o out] main.5
\n
"
);
errorexit
();
errorexit
();
}
}
...
@@ -100,6 +100,9 @@ main(int argc, char *argv[])
...
@@ -100,6 +100,9 @@ main(int argc, char *argv[])
case
'E'
:
case
'E'
:
INITENTRY
=
EARGF
(
usage
());
INITENTRY
=
EARGF
(
usage
());
break
;
break
;
case
'I'
:
interpreter
=
EARGF
(
usage
());
break
;
case
'L'
:
case
'L'
:
Lflag
(
EARGF
(
usage
()));
Lflag
(
EARGF
(
usage
()));
break
;
break
;
...
...
src/cmd/6l/asm.c
View file @
9040da9e
...
@@ -915,14 +915,17 @@ asmb(void)
...
@@ -915,14 +915,17 @@ asmb(void)
sh
->
type
=
SHT_PROGBITS
;
sh
->
type
=
SHT_PROGBITS
;
sh
->
flags
=
SHF_ALLOC
;
sh
->
flags
=
SHF_ALLOC
;
sh
->
addralign
=
1
;
sh
->
addralign
=
1
;
if
(
interpreter
==
nil
)
{
switch
(
HEADTYPE
)
{
switch
(
HEADTYPE
)
{
case
7
:
case
7
:
elfinterp
(
sh
,
startva
,
linuxdynld
)
;
interpreter
=
linuxdynld
;
break
;
break
;
case
9
:
case
9
:
elfinterp
(
sh
,
startva
,
freebsddynld
)
;
interpreter
=
freebsddynld
;
break
;
break
;
}
}
}
elfinterp
(
sh
,
startva
,
interpreter
);
ph
=
newElfPhdr
();
ph
=
newElfPhdr
();
ph
->
type
=
PT_INTERP
;
ph
->
type
=
PT_INTERP
;
...
...
src/cmd/6l/doc.go
View file @
9040da9e
...
@@ -32,6 +32,8 @@ Options new in this version:
...
@@ -32,6 +32,8 @@ Options new in this version:
Write Apple Mach-O binaries (default when $GOOS is darwin)
Write Apple Mach-O binaries (default when $GOOS is darwin)
-H7
-H7
Write Linux ELF binaries (default when $GOOS is linux)
Write Linux ELF binaries (default when $GOOS is linux)
-I interpreter
Set the ELF dynamic linker to use.
-L dir1 -L dir2
-L dir1 -L dir2
Search for libraries (package files) in dir1, dir2, etc.
Search for libraries (package files) in dir1, dir2, etc.
The default is the single location $GOROOT/pkg/$GOOS_amd64.
The default is the single location $GOROOT/pkg/$GOOS_amd64.
...
...
src/cmd/6l/l.h
View file @
9040da9e
...
@@ -352,6 +352,7 @@ EXTERN int nerrors;
...
@@ -352,6 +352,7 @@ EXTERN int nerrors;
EXTERN
char
*
noname
;
EXTERN
char
*
noname
;
EXTERN
char
*
outfile
;
EXTERN
char
*
outfile
;
EXTERN
vlong
pc
;
EXTERN
vlong
pc
;
EXTERN
char
*
interpreter
;
EXTERN
char
*
rpath
;
EXTERN
char
*
rpath
;
EXTERN
int32
spsize
;
EXTERN
int32
spsize
;
EXTERN
Sym
*
symlist
;
EXTERN
Sym
*
symlist
;
...
...
src/cmd/6l/obj.c
View file @
9040da9e
...
@@ -58,7 +58,7 @@ char* paramspace = "FP";
...
@@ -58,7 +58,7 @@ char* paramspace = "FP";
void
void
usage
(
void
)
usage
(
void
)
{
{
fprint
(
2
,
"usage: 6l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-r path] [-o out] main.6
\n
"
);
fprint
(
2
,
"usage: 6l [-options] [-E entry] [-H head] [-
I interpreter] [-
L dir] [-T text] [-R rnd] [-r path] [-o out] main.6
\n
"
);
exits
(
"usage"
);
exits
(
"usage"
);
}
}
...
@@ -96,6 +96,9 @@ main(int argc, char *argv[])
...
@@ -96,6 +96,9 @@ main(int argc, char *argv[])
case
'H'
:
case
'H'
:
HEADTYPE
=
atolwhex
(
EARGF
(
usage
()));
HEADTYPE
=
atolwhex
(
EARGF
(
usage
()));
break
;
break
;
case
'I'
:
interpreter
=
EARGF
(
usage
());
break
;
case
'L'
:
case
'L'
:
Lflag
(
EARGF
(
usage
()));
Lflag
(
EARGF
(
usage
()));
break
;
break
;
...
...
src/cmd/8l/asm.c
View file @
9040da9e
...
@@ -936,14 +936,17 @@ asmb(void)
...
@@ -936,14 +936,17 @@ asmb(void)
sh
->
type
=
SHT_PROGBITS
;
sh
->
type
=
SHT_PROGBITS
;
sh
->
flags
=
SHF_ALLOC
;
sh
->
flags
=
SHF_ALLOC
;
sh
->
addralign
=
1
;
sh
->
addralign
=
1
;
if
(
interpreter
==
nil
)
{
switch
(
HEADTYPE
)
{
switch
(
HEADTYPE
)
{
case
7
:
case
7
:
elfinterp
(
sh
,
startva
,
linuxdynld
)
;
interpreter
=
linuxdynld
;
break
;
break
;
case
9
:
case
9
:
elfinterp
(
sh
,
startva
,
freebsddynld
)
;
interpreter
=
freebsddynld
;
break
;
break
;
}
}
}
elfinterp
(
sh
,
startva
,
interpreter
);
ph
=
newElfPhdr
();
ph
=
newElfPhdr
();
ph
->
type
=
PT_INTERP
;
ph
->
type
=
PT_INTERP
;
...
...
src/cmd/8l/doc.go
View file @
9040da9e
...
@@ -29,6 +29,8 @@ Options new in this version:
...
@@ -29,6 +29,8 @@ Options new in this version:
Write Apple Mach-O binaries (default when $GOOS is darwin)
Write Apple Mach-O binaries (default when $GOOS is darwin)
-H7
-H7
Write Linux ELF binaries (default when $GOOS is linux)
Write Linux ELF binaries (default when $GOOS is linux)
-I interpreter
Set the ELF dynamic linker to use.
-L dir1 -L dir2
-L dir1 -L dir2
Search for libraries (package files) in dir1, dir2, etc.
Search for libraries (package files) in dir1, dir2, etc.
The default is the single location $GOROOT/pkg/$GOOS_386.
The default is the single location $GOROOT/pkg/$GOOS_386.
...
...
src/cmd/8l/l.h
View file @
9040da9e
...
@@ -315,6 +315,7 @@ EXTERN int maxop;
...
@@ -315,6 +315,7 @@ EXTERN int maxop;
EXTERN
int
nerrors
;
EXTERN
int
nerrors
;
EXTERN
char
*
noname
;
EXTERN
char
*
noname
;
EXTERN
int32
pc
;
EXTERN
int32
pc
;
EXTERN
char
*
interpreter
;
EXTERN
char
*
rpath
;
EXTERN
char
*
rpath
;
EXTERN
int32
spsize
;
EXTERN
int32
spsize
;
EXTERN
Sym
*
symlist
;
EXTERN
Sym
*
symlist
;
...
...
src/cmd/8l/obj.c
View file @
9040da9e
...
@@ -64,7 +64,7 @@ char *thestring = "386";
...
@@ -64,7 +64,7 @@ char *thestring = "386";
void
void
usage
(
void
)
usage
(
void
)
{
{
fprint
(
2
,
"usage: 8l [-options] [-E entry] [-H head] [-L dir] [-T text] [-R rnd] [-r path] [-o out] main.8
\n
"
);
fprint
(
2
,
"usage: 8l [-options] [-E entry] [-H head] [-
I interpreter] [-
L dir] [-T text] [-R rnd] [-r path] [-o out] main.8
\n
"
);
exits
(
"usage"
);
exits
(
"usage"
);
}
}
...
@@ -102,6 +102,9 @@ main(int argc, char *argv[])
...
@@ -102,6 +102,9 @@ main(int argc, char *argv[])
case
'H'
:
case
'H'
:
HEADTYPE
=
atolwhex
(
EARGF
(
usage
()));
HEADTYPE
=
atolwhex
(
EARGF
(
usage
()));
break
;
break
;
case
'I'
:
interpreter
=
EARGF
(
usage
());
break
;
case
'L'
:
case
'L'
:
Lflag
(
EARGF
(
usage
()));
Lflag
(
EARGF
(
usage
()));
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment