OSDN Git Service

modpost: detect section mismatch for R_ARM_REL32
authorMasahiro Yamada <masahiroy@kernel.org>
Thu, 1 Jun 2023 12:10:01 +0000 (21:10 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Sat, 3 Jun 2023 16:37:41 +0000 (01:37 +0900)
commit2cb749466d179e3ccfe83eb8a52dc002d07b08af
tree4b80e1815c2b9679621b0b4a2363883ae0540638
parent3310bae805250aec227eb056e8e61a246678f28a
modpost: detect section mismatch for R_ARM_REL32

For ARM, modpost fails to detect some types of section mismatches.

  [test code]

    .section .init.data,"aw"
    bar:
            .long 0

    .section .data,"aw"
    .globl foo
    foo:
            .long bar - .

It is apparently a bad reference, but modpost does not report anything.

The test code above produces the following relocations.

  Relocation section '.rel.data' at offset 0xe8 contains 1 entry:
   Offset     Info    Type            Sym.Value  Sym. Name
  00000000  00000403 R_ARM_REL32       00000000   .init.data

Currently, R_ARM_REL32 is just skipped.

Handle it like R_ARM_ABS32.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/mod/modpost.c