diff --git a/0049-iw-fix-cmd_size-determination-with-LTO.patch b/0049-iw-fix-cmd_size-determination-with-LTO.patch deleted file mode 100644 index eb1681e..0000000 --- a/0049-iw-fix-cmd_size-determination-with-LTO.patch +++ /dev/null @@ -1,58 +0,0 @@ -From ae03bc6effdffe145c871d70ce346f93faefc71b Mon Sep 17 00:00:00 2001 -From: Johannes Berg -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 ---- - 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 - diff --git a/iw-5.0.1.tar.gz b/iw-5.0.1.tar.gz deleted file mode 100644 index ef35130..0000000 Binary files a/iw-5.0.1.tar.gz and /dev/null differ diff --git a/iw-5.9.tar.gz b/iw-5.9.tar.gz new file mode 100644 index 0000000..6276e42 Binary files /dev/null and b/iw-5.9.tar.gz differ diff --git a/iw.spec b/iw.spec index b7e2175..404dad9 100644 --- a/iw.spec +++ b/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 - 5.9-1 +- Type:requirements +- ID:NA +- SUG:NA +- DESC: update iw to 5.9 + * Mon Sep 02 2019 openEuler Buildteam - 5.0.1-1 - Package init