@@ -152,6 +152,9 @@ def _check_non_pie(self, pkg, bin_name):
152
152
We suppose that the package is arch dependent and bin_name is binary
153
153
executable.
154
154
"""
155
+ if self .is_go_elf :
156
+ return
157
+
155
158
if not self .is_shobj and not self .is_pie_exec :
156
159
if any (regex .search (bin_name ) for regex in self .pie_exec_regex_list ):
157
160
self .output .add_info ('E' , pkg ,
@@ -397,7 +400,9 @@ def _check_rpath(self, pkg, pkgfile_path, path):
397
400
def _check_library_dependency (self , pkg , pkgfile_path , path ):
398
401
if self .is_archive :
399
402
return
400
- if path .startswith ('/lib/modules/' ):
403
+ elif path .startswith ('/lib/modules/' ):
404
+ return
405
+ elif self .is_go_elf :
401
406
return
402
407
403
408
dyn_section = self .readelf_parser .dynamic_section_info
@@ -510,6 +515,7 @@ def _detect_attributes(self, magic):
510
515
self .is_archive = 'current ar archive' in magic
511
516
self .is_dynamically_linked = 'dynamically linked' in magic
512
517
self .is_pie_exec = 'pie executable' in magic
518
+ self .is_go_elf = False
513
519
514
520
def run_elf_checks (self , pkg , pkgfile_path , path ):
515
521
if self .is_archive and not self ._is_standard_archive (pkg , pkgfile_path , path ):
@@ -521,6 +527,13 @@ def run_elf_checks(self, pkg, pkgfile_path, path):
521
527
self .output .add_info ('E' , pkg , 'readelf-failed' , path , failed_reason )
522
528
return
523
529
530
+ # Detect go binary
531
+ for elf_file in self .readelf_parser .section_info .elf_files :
532
+ for section in elf_file :
533
+ if section .name == '.note.go.buildid' :
534
+ self .is_go_elf = True
535
+ break
536
+
524
537
if not self .is_archive :
525
538
if self .is_dynamically_linked :
526
539
is_installed_pkg = isinstance (pkg , InstalledPkg ) or isinstance (pkg , FakePkg )
0 commit comments