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
304b7954
Commit
304b7954
authored
Jul 21, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a .interp section and fix vaddr in INTERP prog.
R=rsc DELTA=16 (9 added, 3 deleted, 4 changed) OCL=31956 CL=31963
parent
d426b638
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
asm.c
src/cmd/6l/asm.c
+13
-7
No files found.
src/cmd/6l/asm.c
View file @
304b7954
...
...
@@ -450,12 +450,21 @@ asmb(void)
ph
->
type
=
PT_INTERP
;
ph
->
flags
=
PF_R
;
ph
->
off
=
startelf
();
ph
->
vaddr
=
startva
;
ph
->
paddr
=
startva
;
ph
->
vaddr
=
startva
+
ph
->
off
;
ph
->
paddr
=
startva
+
ph
->
off
;
write
(
cout
,
linuxdynld
,
sizeof
linuxdynld
);
ph
->
filesz
=
endelf
()
-
ph
->
off
;
ph
->
align
=
1
;
sh
=
newElf64SHdr
(
".interp"
);
sh
->
type
=
SHT_PROGBITS
;
sh
->
flags
=
SHF_ALLOC
;
sh
->
addr
=
va
;
sh
->
off
=
ph
->
off
;
sh
->
addr
=
startva
+
sh
->
off
;
sh
->
size
=
ph
->
filesz
;
sh
->
addralign
=
1
;
/* dynamic load section */
ph
=
newElf64PHdr
();
ph
->
type
=
PT_LOAD
;
...
...
@@ -521,9 +530,6 @@ asmb(void)
elf64writedynent
(
DT_RELAENT
,
ELF64RELASIZE
);
elf64writedynent
(
DT_STRSZ
,
STRTABSIZE
);
elf64writedynent
(
DT_SYMENT
,
0
);
elf64writedynent
(
DT_REL
,
startva
);
elf64writedynent
(
DT_RELSZ
,
0
);
elf64writedynent
(
DT_RELENT
,
ELF64RELSIZE
);
elf64writedynent
(
DT_NULL
,
0
);
cflush
();
dynsh
->
size
=
seek
(
cout
,
0
,
1
)
-
dynsh
->
off
;
...
...
@@ -578,8 +584,8 @@ asmb(void)
}
ph
=
newElf64PHdr
();
ph
->
type
=
0x6474e551
;
/*
gok
*/
ph
->
flags
=
PF_
X
+
PF_
W
+
PF_R
;
ph
->
type
=
0x6474e551
;
/*
GNU_STACK
*/
ph
->
flags
=
PF_W
+
PF_R
;
ph
->
align
=
8
;
fo
=
ELF64RESERVE
;
...
...
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