]> git.ipfire.org Git - thirdparty/iw.git/commit
iw: change __cmd section scheme to fit gcc/clang
authorJohannes Berg <johannes.berg@intel.com>
Thu, 2 May 2019 08:05:47 +0000 (10:05 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 2 May 2019 08:05:47 +0000 (10:05 +0200)
commit338059ace9d00adca6015f75f465e7c47cb63ea7
tree4ee86b2b5bdd6de31f73625cbdaf5304c4890c1b
parent5bdf11e31fcbdc9d80ba2229d9d73a4b023652d3
iw: change __cmd section scheme to fit gcc/clang

There are some behaviour differences in how gcc and clang
fill a special section like the one we use for __cmd here.

In both compilers, obviously all variables declared like
this end up in the special __cmd section.

However, alignment and padding is applied differently by
different compilers and linkers, and as such it is hard to
really rely on being able to treat this like an array.

To avoid all these issues, put just *pointers* to the
structures into the special section, which makes it easy
to skip NULL pointers (resulting from padding) and has no
issues with alignment as they're always smaller than the
alignment applied.

Change-Id: I35e2c66e541758e60363883d26b31d2040ce8aa9
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw.c
iw.h