@@ -77,12 +77,10 @@ def getSectionSizeAndOffset(sectionName, filename):
77
77
return (size , offset )
78
78
except ValueError :
79
79
continue
80
-
81
- # The needed section could not be found
82
- raise Exception ('Could not find "{0}" ELF section in "{1}"' .format (
83
- sectionName ,
84
- filename )
85
- )
80
+
81
+ # The needed section could not be found
82
+ logging .error ('Could not find "{0}" ELF section in "{1}"' .format (sectionName ,filename ))
83
+ return None
86
84
87
85
# Read the entire content of an ELF section into a string
88
86
def getSectionContent (size , offset , filename ):
@@ -131,7 +129,10 @@ def extract_section_darwin(inputFile):
131
129
# os independent abstraction (*nix version)
132
130
#analagous procedure for linux (relying on getSectionSizeAndOffset and getSectionContent)
133
131
def extract_section_linux (inputFile ):
134
- (sectionSize , sectionOffset ) = getSectionSizeAndOffset (elfSectionName , inputFile )
132
+ val = getSectionSizeAndOffset (elfSectionName , inputFile )
133
+ if val is None :
134
+ return []
135
+ (sectionSize , sectionOffset ) = val
135
136
content = getSectionContent (sectionSize , sectionOffset , inputFile )
136
137
contents = content .split ('\n ' )
137
138
if not contents :
@@ -198,7 +199,7 @@ def handleArchive(inputFile, outputFile, arCmd, fileType, extractor, llvmArchive
198
199
arP = Popen (arCmd )
199
200
except OSError as e :
200
201
if e .errno == 2 :
201
- errorMsg = "Your llvm- ar doesn't seem to be easy to find.\n Either install it or use the -a llvmArchiver option. "
202
+ errorMsg = "Your ar doesn't seem to be easy to find.\n "
202
203
else :
203
204
errorMsg = "OS error({0}): {1}" .format (e .errno , e .strerror )
204
205
logging .error (errorMsg )
@@ -240,7 +241,7 @@ def handleArchive(inputFile, outputFile, arCmd, fileType, extractor, llvmArchive
240
241
241
242
#write the manifest file if asked for
242
243
if manifestFlag :
243
- manifestFile = '{0}.occcam .manifest' .format (inputFile )
244
+ manifestFile = '{0}.llvm .manifest' .format (inputFile )
244
245
with open (manifestFile , 'w' ) as output :
245
246
for f in bitCodeFiles :
246
247
output .write ('{0}\n ' .format (f ))
0 commit comments