update iw to 5.9
This commit is contained in:
parent
5b08a79f05
commit
b446f7795a
@ -1,58 +0,0 @@
|
||||
From ae03bc6effdffe145c871d70ce346f93faefc71b Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Thu, 28 Feb 2019 21:34:03 +0100
|
||||
Subject: [PATCH 49/50] iw: fix cmd_size determination with LTO
|
||||
|
||||
Use a separate section to determine the cmd_size as in LTO
|
||||
the entries in __cmd get freely rearranged, leading to a
|
||||
(usually) very large cmd_size, and thus to the whole thing
|
||||
not working.
|
||||
|
||||
Change-Id: I3437ad34de1d927961a3e98f109794d7a884327f
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
iw.c | 21 ++++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/iw.c b/iw.c
|
||||
index 76f152d..afc8118 100644
|
||||
--- a/iw.c
|
||||
+++ b/iw.c
|
||||
@@ -542,6 +542,25 @@ int handle_cmd(struct nl80211_state *state, enum id_input idby,
|
||||
return __handle_cmd(state, idby, argc, argv, NULL);
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Unfortunately, I don't know how densely the linker packs the struct cmd.
|
||||
+ * For example, if you have a 72-byte struct cmd, the linker will pad each
|
||||
+ * out to 96 bytes before putting them together in the section. There must
|
||||
+ * be some algorithm, but I haven't found it yet.
|
||||
+ *
|
||||
+ * We used to calculate this by taking the (abs value of) the difference
|
||||
+ * between __section_get and __section_set, but if LTO is enabled then this
|
||||
+ * stops working because the entries of the "__cmd" section get rearranged
|
||||
+ * freely by the compiler/linker.
|
||||
+ *
|
||||
+ * Fix this by using yet another "__sizer" section that only contains these
|
||||
+ * two entries - then the (abs value of) the difference between them will
|
||||
+ * be how they get packed and that can be used to iterate the __cmd section
|
||||
+ * as well.
|
||||
+ */
|
||||
+static struct cmd sizer1 __attribute__((used,section("__sizer"))) = {};
|
||||
+static struct cmd sizer2 __attribute__((used,section("__sizer"))) = {};
|
||||
+
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct nl80211_state nlstate;
|
||||
@@ -549,7 +568,7 @@ int main(int argc, char **argv)
|
||||
const struct cmd *cmd = NULL;
|
||||
|
||||
/* calculate command size including padding */
|
||||
- cmd_size = labs((long)&__section_set - (long)&__section_get);
|
||||
+ cmd_size = labs((uintptr_t)&sizer2 - (uintptr_t)&sizer1);
|
||||
/* strip off self */
|
||||
argc--;
|
||||
argv0 = *argv++;
|
||||
--
|
||||
1.8.3.1
|
||||
|
||||
BIN
iw-5.0.1.tar.gz
BIN
iw-5.0.1.tar.gz
Binary file not shown.
BIN
iw-5.9.tar.gz
Normal file
BIN
iw-5.9.tar.gz
Normal file
Binary file not shown.
10
iw.spec
10
iw.spec
@ -1,5 +1,5 @@
|
||||
Name: iw
|
||||
Version: 5.0.1
|
||||
Version: 5.9
|
||||
Release: 1
|
||||
Summary: A nl80211 based wireless configuration tool
|
||||
|
||||
@ -7,8 +7,6 @@ License: ISC
|
||||
URL: https://wireless.kernel.org/en/users/Documentation/%{name}
|
||||
Source0: https://www.kernel.org/pub/software/network/%{name}/%{name}-%{version}.tar.gz
|
||||
|
||||
Patch6000: 0049-iw-fix-cmd_size-determination-with-LTO.patch
|
||||
|
||||
BuildRequires: gcc kernel-headers libnl3-devel pkgconfig
|
||||
|
||||
%description
|
||||
@ -39,5 +37,11 @@ export CFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS"
|
||||
%{_mandir}/man8/iw.*
|
||||
|
||||
%changelog
|
||||
* Fri Jan 22 2021 xihaochen<xihaochen@huawei.com> - 5.9-1
|
||||
- Type:requirements
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: update iw to 5.9
|
||||
|
||||
* Mon Sep 02 2019 openEuler Buildteam <buildteam@openeuler.org> - 5.0.1-1
|
||||
- Package init
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user