Skip to content

Commit 1648995

Browse files
authored
[Auditor] Add more ignored libraries (#1169)
* [Auditor] Add more ignored libraries * Un-ignore libz * Ignore more libraries
1 parent 9dade52 commit 1648995

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

src/Auditor.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ function check_dynamic_linkage(oh, prefix, bin_files;
340340
libs = find_libraries(oh)
341341
ignored_libraries = String[]
342342
for libname in keys(libs)
343-
if should_ignore_lib(libname, oh)
343+
if should_ignore_lib(libname, oh, platform)
344344
push!(ignored_libraries, libname)
345345
continue
346346
end

src/auditor/dynamic_linkage.jl

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function is_for_platform(h::ObjectHandle, platform::AbstractPlatform)
150150
end
151151

152152
# These are libraries we should straight-up ignore, like libsystem on OSX
153-
function should_ignore_lib(lib, ::ELFHandle)
153+
function should_ignore_lib(lib, ::ELFHandle, platform::AbstractPlatform)
154154
ignore_libs = [
155155
# dynamic loaders
156156
"ld-linux-x86-64.so.2",
@@ -184,18 +184,32 @@ function should_ignore_lib(lib, ::ELFHandle)
184184
"libthr.so.3",
185185
"libpthread.so.0",
186186
]
187+
if Sys.isfreebsd(platform)
188+
push!(ignore_libs,
189+
# From FreeBSD SDK
190+
"libdevstat.sos.7",
191+
"libexecinfo.so.1",
192+
"libkvm.so.7",
193+
)
194+
end
187195
return lowercase(basename(lib)) in ignore_libs
188196
end
189-
function should_ignore_lib(lib, ::MachOHandle)
197+
function should_ignore_lib(lib, ::MachOHandle, platform::AbstractPlatform)
190198
ignore_libs = [
191199
"libsystem.b.dylib",
192200
# This is not built by clang or GCC, so we leave it as a system library
193201
"libc++.1.dylib",
194202
"libresolv.9.dylib",
203+
# Frameworks in the SDK
204+
"corefoundation",
205+
"foundation",
206+
"iokit",
207+
"security",
208+
"systemconfiguration",
195209
]
196210
return lowercase(basename(lib)) in ignore_libs
197211
end
198-
function should_ignore_lib(lib, ::COFFHandle)
212+
function should_ignore_lib(lib, ::COFFHandle, platform::AbstractPlatform)
199213
ignore_libs = [
200214
# Core runtime libs
201215
"ntdll.dll",
@@ -228,6 +242,9 @@ function should_ignore_lib(lib, ::COFFHandle)
228242
"winhttp.dll",
229243
"msimg32.dll",
230244
"dnsapi.dll",
245+
"wsock32.dll",
246+
"psapi.dll",
247+
"bcrypt.dll",
231248

232249
# Compiler support libraries
233250
"libgcc_s_seh-1.dll",

0 commit comments

Comments
 (0)