Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
728003e3
Commit
728003e3
authored
Sep 01, 2010
by
Luuk van Dijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
6l/8l: emit DWARF in macho.
R=rsc, r, ken2 CC=golang-dev
https://golang.org/cl/2128041
parent
49b19e1b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
7 deletions
+41
-7
src/cmd/6l/asm.c
src/cmd/6l/asm.c
+1
-1
src/cmd/8l/asm.c
src/cmd/8l/asm.c
+1
-1
src/cmd/ld/dwarf.c
src/cmd/ld/dwarf.c
+31
-1
src/cmd/ld/dwarf.h
src/cmd/ld/dwarf.h
+3
-2
src/cmd/ld/macho.c
src/cmd/ld/macho.c
+5
-2
No files found.
src/cmd/6l/asm.c
View file @
728003e3
...
...
@@ -929,7 +929,7 @@ asmb(void)
sh
->
size
=
elfstrsize
;
sh
->
addralign
=
1
;
dwarfaddheaders
();
dwarfadd
elf
headers
();
}
sh
=
newElfShstrtab
(
elfstr
[
ElfStrShstrtab
]);
...
...
src/cmd/8l/asm.c
View file @
728003e3
...
...
@@ -1050,7 +1050,7 @@ asmb(void)
sh
->
addralign
=
1
;
sh
->
addr
=
symdatva
+
8
+
symsize
;
dwarfaddheaders
();
dwarfadd
elf
headers
();
}
sh
=
newElfShstrtab
(
elfstr
[
ElfStrShstrtab
]);
...
...
src/cmd/ld/dwarf.c
View file @
728003e3
...
...
@@ -7,6 +7,7 @@
#include "../ld/dwarf.h"
#include "../ld/dwarf_defs.h"
#include "../ld/elf.h"
#include "../ld/macho.h"
/*
* Offsets and sizes of the .debug_* sections in the cout file.
...
...
@@ -835,7 +836,7 @@ dwarfemitdebugsections(void)
}
void
dwarfaddheaders
(
void
)
dwarfadd
elf
headers
(
void
)
{
ElfShdr
*
sh
;
...
...
@@ -857,3 +858,32 @@ dwarfaddheaders(void)
sh
->
size
=
infosize
;
sh
->
addralign
=
1
;
}
void
dwarfaddmachoheaders
(
void
)
{
MachoSect
*
msect
;
MachoSeg
*
ms
;
vlong
fakestart
;
// Zero vsize segments won't be loaded in memory, even so they
// have to be page aligned in the file.
fakestart
=
abbrevo
&
~
0xfff
;
ms
=
newMachoSeg
(
"__DWARF"
,
3
);
ms
->
fileoffset
=
fakestart
;
ms
->
filesize
=
abbrevo
-
fakestart
+
abbrevsize
+
linesize
+
infosize
;
msect
=
newMachoSect
(
ms
,
"__debug_abbrev"
);
msect
->
off
=
abbrevo
;
msect
->
size
=
abbrevsize
;
msect
=
newMachoSect
(
ms
,
"__debug_line"
);
msect
->
off
=
lineo
;
msect
->
size
=
linesize
;
msect
=
newMachoSect
(
ms
,
"__debug_info"
);
msect
->
off
=
infoo
;
msect
->
size
=
infosize
;
}
src/cmd/ld/dwarf.h
View file @
728003e3
...
...
@@ -22,7 +22,8 @@ void dwarfaddshstrings(Sym *shstrtab);
void
dwarfemitdebugsections
(
void
);
/*
* Add
ELF
section headers pointing to the sections emitted in
* Add section headers pointing to the sections emitted in
* dwarfemitdebugsections.
*/
void
dwarfaddheaders
(
void
);
void
dwarfaddelfheaders
(
void
);
void
dwarfaddmachoheaders
(
void
);
src/cmd/ld/macho.c
View file @
728003e3
...
...
@@ -6,6 +6,7 @@
// http://developer.apple.com/mac/library/DOCUMENTATION/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html
#include "l.h"
#include "../ld/dwarf.h"
#include "../ld/lib.h"
#include "../ld/macho.h"
...
...
@@ -129,7 +130,7 @@ machowrite(void)
MachoDebug
*
d
;
MachoLoad
*
l
;
o1
=
Boffset
(
&
bso
);
o1
=
cpos
(
);
loadsize
=
4
*
4
*
ndebug
;
for
(
i
=
0
;
i
<
nload
;
i
++
)
...
...
@@ -229,7 +230,7 @@ machowrite(void)
LPUT
(
d
->
filesize
);
}
return
Boffset
(
&
bso
)
-
o1
;
return
cpos
(
)
-
o1
;
}
static
void
*
...
...
@@ -617,6 +618,8 @@ asmbmacho(vlong symdatva, vlong symo)
md
=
newMachoDebug
();
md
->
fileoffset
=
symo
+
8
+
symsize
;
md
->
filesize
=
lcsize
;
dwarfaddmachoheaders
();
}
a
=
machowrite
();
...
...
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