From: Greg Kroah-Hartman Date: Sat, 8 Jul 2017 16:02:57 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v4.9.37~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=454bd39d64dc0851ce7cf42d993d670811c88dbb;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: x86-tools-fix-gcc-7-warning-in-relocs.c.patch --- diff --git a/queue-4.4/series b/queue-4.4/series index 8a4332e9ca3..88331e6818a 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -22,3 +22,4 @@ pinctrl-sh-pfc-update-info-pointer-after-soc-specific-init.patch usb-serial-option-add-two-longcheer-device-ids.patch usb-serial-qcserial-new-sierra-wireless-em7305-device-id.patch gfs2-fix-glock-rhashtable-rcu-bug.patch +x86-tools-fix-gcc-7-warning-in-relocs.c.patch diff --git a/queue-4.4/x86-tools-fix-gcc-7-warning-in-relocs.c.patch b/queue-4.4/x86-tools-fix-gcc-7-warning-in-relocs.c.patch new file mode 100644 index 00000000000..310ff805550 --- /dev/null +++ b/queue-4.4/x86-tools-fix-gcc-7-warning-in-relocs.c.patch @@ -0,0 +1,54 @@ +From 7ebb916782949621ff6819acf373a06902df7679 Mon Sep 17 00:00:00 2001 +From: Markus Trippelsdorf +Date: Thu, 15 Dec 2016 13:45:13 +0100 +Subject: x86/tools: Fix gcc-7 warning in relocs.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Markus Trippelsdorf + +commit 7ebb916782949621ff6819acf373a06902df7679 upstream. + +gcc-7 warns: + +In file included from arch/x86/tools/relocs_64.c:17:0: +arch/x86/tools/relocs.c: In function ‘process_64’: +arch/x86/tools/relocs.c:953:2: warning: argument 1 null where non-null expected [-Wnonnull] + qsort(r->offset, r->count, sizeof(r->offset[0]), cmp_relocs); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In file included from arch/x86/tools/relocs.h:6:0, + from arch/x86/tools/relocs_64.c:1: +/usr/include/stdlib.h:741:13: note: in a call to function ‘qsort’ declared here + extern void qsort + +This happens because relocs16 is not used for ELF_BITS == 64, +so there is no point in trying to sort it. + +Make the sort_relocs(&relocs16) call 32bit only. + +Signed-off-by: Markus Trippelsdorf +Link: http://lkml.kernel.org/r/20161215124513.GA289@x4 +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/tools/relocs.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/x86/tools/relocs.c ++++ b/arch/x86/tools/relocs.c +@@ -992,11 +992,12 @@ static void emit_relocs(int as_text, int + die("Segment relocations found but --realmode not specified\n"); + + /* Order the relocations for more efficient processing */ +- sort_relocs(&relocs16); + sort_relocs(&relocs32); + #if ELF_BITS == 64 + sort_relocs(&relocs32neg); + sort_relocs(&relocs64); ++#else ++ sort_relocs(&relocs16); + #endif + + /* Print the relocations */