Skip to content

Commit 6e2e340

Browse files
tmlindRussell King
authored andcommitted
ARM: 7324/1: modpost: Fix section warnings for ARM for many compilers
It turns out that many compilers don't show section warnings on ARM currently because handling for ARM_CALL relocs are missing from modpost.c. Based on commit c2e2611 ([ARM] 3205/1: Handle new EABI relocations when loading kernel modules) it seems that R_ARM_PC24, R_ARM_CALL and R_ARM_JUMP24 can be handled the same way. Note that at least Debian libc6-dev is missing defines for both R_ARM_CALL and R_ARM_JUMP24 in /usr/include/elf.h. So for now we need to define them in modpost.c if not defined. Acked-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Anders Kaseorg <andersk@ksplice.com> Cc: Greg KH <gregkh@linuxfoundation.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 08a183f commit 6e2e340

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎scripts/mod/modpost.c‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,13 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
14941494
return 0;
14951495
}
14961496

1497+
#ifndef R_ARM_CALL
1498+
#define R_ARM_CALL 28
1499+
#endif
1500+
#ifndef R_ARM_JUMP24
1501+
#define R_ARM_JUMP24 29
1502+
#endif
1503+
14971504
static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
14981505
{
14991506
unsigned int r_typ = ELF_R_TYPE(r->r_info);
@@ -1505,6 +1512,8 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
15051512
(elf->symtab_start + ELF_R_SYM(r->r_info));
15061513
break;
15071514
case R_ARM_PC24:
1515+
case R_ARM_CALL:
1516+
case R_ARM_JUMP24:
15081517
/* From ARM ABI: ((S + A) | T) - P */
15091518
r->r_addend = (int)(long)(elf->hdr +
15101519
sechdr->sh_offset +

0 commit comments

Comments
 (0)