History

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 c2e26114 ([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.

Tony Lindgren committed 14 years ago

Commit 6e2e3401 parent 08a183f1 file · +9 −0Browse files

Unified · Split

scripts/mod/modpost.c+9−0
@@ -1494,6 +1494,13 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) · 1493 unmodified lines
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) · 5 unmodified lines
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 +