Skip to content
Commit b614a697 authored by Anders Kaseorg's avatar Anders Kaseorg Committed by Sam Ravnborg
Browse files

kbuild, modpost: Check the section flags, to catch missing "ax"/"aw"



When you put
  .section ".foo"
in an assembly file instead of
  .section "foo", "ax"
, one of the possible symptoms is that modpost will see an
ld-generated section name ".foo.1" in section_rel() or section_rela().
But this heuristic has two problems: it will miss a bad section that
has no relocations, and it will incorrectly flag many gcc-generated
sections as bad when compiling with -ffunction-sections
-fdata-sections.

On mips it fixes a lot of bogus warnings with gcc 4.4.0 lije this one:
WARNING: crypto/cryptd.o (.text.T.349): unexpected section name.

So instead of checking whether the section name matches a particular
pattern, we directly check for a missing SHF_ALLOC in the section
flags.

Signed-off-by: default avatarAnders Kaseorg <andersk@mit.edu>
Tested-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent c993971f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment