From 990d3b1fb58c6865f120cdd20b82cb1dd654816d54a36f166b1d45287dc82178 Mon Sep 17 00:00:00 2001 From: Johannes Segitz Date: Thu, 8 Aug 2019 14:14:21 +0000 Subject: [PATCH] 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 --- ...non-zero-.text-segment-in-.a-archive.patch | 20 ++++++++++--------- rpmlint.changes | 6 ++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/add-check-for-a-non-zero-.text-segment-in-.a-archive.patch b/add-check-for-a-non-zero-.text-segment-in-.a-archive.patch index 1df07d1..60af9d5 100644 --- a/add-check-for-a-non-zero-.text-segment-in-.a-archive.patch +++ b/add-check-for-a-non-zero-.text-segment-in-.a-archive.patch @@ -1,5 +1,5 @@ diff --git a/BinariesCheck.py b/BinariesCheck.py -index 36d73f8..7257ffd 100644 +index 36d73f8..562c56a 100644 --- a/BinariesCheck.py +++ b/BinariesCheck.py @@ -73,6 +73,10 @@ class BinaryInfo(object): @@ -29,7 +29,7 @@ index 36d73f8..7257ffd 100644 # Currently this implementation works only on specific # architectures due to reliance on arch specific assembly. 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)) if not res[0]: lines = res[1].splitlines() @@ -41,18 +41,20 @@ index 36d73f8..7257ffd 100644 + + for line in lines: + r = self.section_regex.search(line) -+ if r and r.group('section').startswith('.text'): -+ has_text_segment = True -+ size = int(r.group('size'), 16) -+ if size > 0: -+ non_zero_text_segment = True ++ if r: ++ sn = r.group('section') ++ if sn == '.init_array' or sn == '.fini_array' or sn.startswith('.text'): ++ has_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: + self.no_text_in_archive = True + for line in lines: if BinaryInfo.lto_section_name_prefix in line: 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: printError(pkg, 'lto-bytecode', fname) @@ -62,7 +64,7 @@ index 36d73f8..7257ffd 100644 for ec in bin_info.forbidden_calls: printWarning(pkg, ec, fname, 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', '''This executable contains a LTO section. LTO bytecode is not portable and should not be distributed in static libraries or e.g. Python modules.''', diff --git a/rpmlint.changes b/rpmlint.changes index c174b27..b4dfea3 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 8 12:45:30 UTC 2019 - Martin Liška + +- 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