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
4566868b
Commit
4566868b
authored
Oct 18, 2011
by
Mikkel Krautz
Committed by
Russ Cox
Oct 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6l, 8l: emit macho dwarf info before linkedit section
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5272050
parent
c7cf56be
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
7 deletions
+28
-7
asm.c
src/cmd/6l/asm.c
+13
-3
asm.c
src/cmd/8l/asm.c
+13
-3
lib.h
src/cmd/ld/lib.h
+1
-0
macho.c
src/cmd/ld/macho.c
+1
-1
No files found.
src/cmd/6l/asm.c
View file @
4566868b
...
...
@@ -703,7 +703,7 @@ asmb(void)
{
int32
magic
;
int
a
,
dynsym
;
vlong
vl
,
startva
,
symo
,
machlink
;
vlong
vl
,
startva
,
symo
,
dwarfoff
,
machlink
;
ElfEhdr
*
eh
;
ElfPhdr
*
ph
,
*
pph
;
ElfShdr
*
sh
;
...
...
@@ -738,8 +738,19 @@ asmb(void)
datblk
(
segdata
.
vaddr
,
segdata
.
filelen
);
machlink
=
0
;
if
(
HEADTYPE
==
Hdarwin
)
if
(
HEADTYPE
==
Hdarwin
)
{
if
(
debug
[
'v'
])
Bprint
(
&
bso
,
"%5.2f dwarf
\n
"
,
cputime
());
dwarfoff
=
rnd
(
HEADR
+
segtext
.
len
,
INITRND
)
+
rnd
(
segdata
.
filelen
,
INITRND
);
cseek
(
dwarfoff
);
segdwarf
.
fileoff
=
cpos
();
dwarfemitdebugsections
();
segdwarf
.
filelen
=
cpos
()
-
segdwarf
.
fileoff
;
machlink
=
domacholink
();
}
switch
(
HEADTYPE
)
{
default:
...
...
@@ -811,7 +822,6 @@ asmb(void)
dwarfemitdebugsections
();
}
break
;
case
Hdarwin
:
case
Hwindows
:
if
(
debug
[
'v'
])
Bprint
(
&
bso
,
"%5.2f dwarf
\n
"
,
cputime
());
...
...
src/cmd/8l/asm.c
View file @
4566868b
...
...
@@ -660,7 +660,7 @@ asmb(void)
{
int32
v
,
magic
;
int
a
,
dynsym
;
uint32
symo
,
startva
,
machlink
;
uint32
symo
,
startva
,
dwarfoff
,
machlink
;
ElfEhdr
*
eh
;
ElfPhdr
*
ph
,
*
pph
;
ElfShdr
*
sh
;
...
...
@@ -691,8 +691,19 @@ asmb(void)
datblk
(
segdata
.
vaddr
,
segdata
.
filelen
);
machlink
=
0
;
if
(
HEADTYPE
==
Hdarwin
)
if
(
HEADTYPE
==
Hdarwin
)
{
if
(
debug
[
'v'
])
Bprint
(
&
bso
,
"%5.2f dwarf
\n
"
,
cputime
());
dwarfoff
=
rnd
(
HEADR
+
segtext
.
len
,
INITRND
)
+
rnd
(
segdata
.
filelen
,
INITRND
);
cseek
(
dwarfoff
);
segdwarf
.
fileoff
=
cpos
();
dwarfemitdebugsections
();
segdwarf
.
filelen
=
cpos
()
-
segdwarf
.
fileoff
;
machlink
=
domacholink
();
}
if
(
iself
)
{
/* index of elf text section; needed by asmelfsym, double-checked below */
...
...
@@ -772,7 +783,6 @@ asmb(void)
cflush
();
}
break
;
case
Hdarwin
:
case
Hwindows
:
if
(
debug
[
'v'
])
Bprint
(
&
bso
,
"%5.2f dwarf
\n
"
,
cputime
());
...
...
src/cmd/ld/lib.h
View file @
4566868b
...
...
@@ -129,6 +129,7 @@ EXTERN int havedynamic;
EXTERN
Segment
segtext
;
EXTERN
Segment
segdata
;
EXTERN
Segment
segsym
;
EXTERN
Segment
segdwarf
;
void
addlib
(
char
*
src
,
char
*
obj
);
void
addlibpath
(
char
*
srcref
,
char
*
objref
,
char
*
file
,
char
*
pkg
);
...
...
src/cmd/ld/macho.c
View file @
4566868b
...
...
@@ -505,7 +505,7 @@ domacholink(void)
size
=
s1
->
size
+
s2
->
size
+
s3
->
size
+
s4
->
size
;
if
(
size
>
0
)
{
linkoff
=
rnd
(
HEADR
+
segtext
.
len
,
INITRND
)
+
rnd
(
segdata
.
filelen
,
INITRND
);
linkoff
=
rnd
(
HEADR
+
segtext
.
len
,
INITRND
)
+
rnd
(
segdata
.
filelen
,
INITRND
)
+
rnd
(
segdwarf
.
filelen
,
INITRND
)
;
cseek
(
linkoff
);
cwrite
(
s1
->
p
,
s1
->
size
);
...
...
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