SHA256
1
0
forked from pool/rpmlint

Accepting request 721765 from home:marxin:branches:devel:openSUSE:Factory:rpmlint

- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
  80126f7c7854d962cc64e54a6ab7e97067bb490d

OBS-URL: https://build.opensuse.org/request/show/721765
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=678
This commit is contained in:
Johannes Segitz 2019-08-08 14:14:21 +00:00 committed by Git OBS Bridge
parent 2e95706365
commit 990d3b1fb5
2 changed files with 17 additions and 9 deletions

View File

@ -1,5 +1,5 @@
diff --git a/BinariesCheck.py b/BinariesCheck.py diff --git a/BinariesCheck.py b/BinariesCheck.py
index 36d73f8..7257ffd 100644 index 36d73f8..562c56a 100644
--- a/BinariesCheck.py --- a/BinariesCheck.py
+++ b/BinariesCheck.py +++ b/BinariesCheck.py
@@ -73,6 +73,10 @@ class BinaryInfo(object): @@ -73,6 +73,10 @@ class BinaryInfo(object):
@ -29,7 +29,7 @@ index 36d73f8..7257ffd 100644
# Currently this implementation works only on specific # Currently this implementation works only on specific
# architectures due to reliance on arch specific assembly. # architectures due to reliance on arch specific assembly.
if (pkg.arch.startswith('armv') or pkg.arch == 'aarch64'): if (pkg.arch.startswith('armv') or pkg.arch == 'aarch64'):
@@ -117,6 +123,22 @@ class BinaryInfo(object): @@ -117,6 +123,24 @@ class BinaryInfo(object):
('readelf', '-W', '-S', '-l', '-d', '-s', path)) ('readelf', '-W', '-S', '-l', '-d', '-s', path))
if not res[0]: if not res[0]:
lines = res[1].splitlines() lines = res[1].splitlines()
@ -41,18 +41,20 @@ index 36d73f8..7257ffd 100644
+ +
+ for line in lines: + for line in lines:
+ r = self.section_regex.search(line) + r = self.section_regex.search(line)
+ if r and r.group('section').startswith('.text'): + if r:
+ has_text_segment = True + sn = r.group('section')
+ size = int(r.group('size'), 16) + if sn == '.init_array' or sn == '.fini_array' or sn.startswith('.text'):
+ if size > 0: + has_text_segment = True
+ non_zero_text_segment = True + size = int(r.group('size'), 16)
+ if size > 0:
+ non_zero_text_segment = True
+ if has_text_segment and not non_zero_text_segment: + if has_text_segment and not non_zero_text_segment:
+ self.no_text_in_archive = True + self.no_text_in_archive = True
+ +
for line in lines: for line in lines:
if BinaryInfo.lto_section_name_prefix in line: if BinaryInfo.lto_section_name_prefix in line:
self.lto_sections = True self.lto_sections = True
@@ -522,6 +544,9 @@ class BinariesCheck(AbstractCheck.AbstractCheck): @@ -522,6 +546,9 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
if bin_info.lto_sections: if bin_info.lto_sections:
printError(pkg, 'lto-bytecode', fname) printError(pkg, 'lto-bytecode', fname)
@ -62,7 +64,7 @@ index 36d73f8..7257ffd 100644
for ec in bin_info.forbidden_calls: for ec in bin_info.forbidden_calls:
printWarning(pkg, ec, fname, printWarning(pkg, ec, fname,
BinaryInfo.forbidden_functions[ec]['f_name']) BinaryInfo.forbidden_functions[ec]['f_name'])
@@ -846,6 +871,10 @@ implementations only strip if the permission is 0755).''', @@ -846,6 +873,10 @@ implementations only strip if the permission is 0755).''',
'lto-bytecode', 'lto-bytecode',
'''This executable contains a LTO section. LTO bytecode is not portable '''This executable contains a LTO section. LTO bytecode is not portable
and should not be distributed in static libraries or e.g. Python modules.''', and should not be distributed in static libraries or e.g. Python modules.''',

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Aug 8 12:45:30 UTC 2019 - Martin Liška <mliska@suse.cz>
- Update add-check-for-a-non-zero-.text-segment-in-.a-archive.patch patch to align with:
80126f7c7854d962cc64e54a6ab7e97067bb490d
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Aug 2 07:53:03 UTC 2019 - Martin Liška <mliska@suse.cz> Fri Aug 2 07:53:03 UTC 2019 - Martin Liška <mliska@suse.cz>