@@ -12,7 +12,7 @@ constituent ELF or MACH-O objects and read their bitcode sections and
12
12
create a LLVM Bitcode archive from the bitcode files.
13
13
14
14
The above language is deliberately vague, since ELF contains a
15
- .llvm_bc section, whereas the MACH-O contains a segement called __LLVM
15
+ .llvm_bc section, whereas the MACH-O contains a segment called __LLVM
16
16
that contains a section called __llvm_bc.
17
17
18
18
"""
@@ -96,7 +96,8 @@ def getSectionContent(size, offset, filename):
96
96
# nulls.
97
97
return d .replace ('\0 ' , '' )
98
98
99
- #use otool to insert the segment and section
99
+ # os independent abstraction (darwin version)
100
+ #use otool to extract the segment and section
100
101
#iam: "xxd -r" would just refuse to play nice, so it got tossed.
101
102
# if any one can get
102
103
# otool -X -s __LLVM __llvm_bc inputFile | xxd -r
@@ -122,7 +123,8 @@ def extract_section_darwin(inputFile):
122
123
logging .error ('{0} contained no {1} segment' .format (inputFile , darwinSegmentName ))
123
124
return contents
124
125
125
- #analagous procedure for linux (relying on objcopy)
126
+ # os independent abstraction (*nix version)
127
+ #analagous procedure for linux (relying on getSectionSizeAndOffset and getSectionContent)
126
128
def extract_section_linux (inputFile ):
127
129
(sectionSize , sectionOffset ) = getSectionSizeAndOffset (elfSectionName , inputFile )
128
130
content = getSectionContent (sectionSize , sectionOffset , inputFile )
0 commit comments