diff options
author | Tony Lindgren <tony@atomide.com> | 2012-02-14 15:58:56 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-02-15 06:04:36 -0500 |
commit | 6e2e340b59d2d4e7b6b7f2c2d02b0d5ca4df6458 (patch) | |
tree | 2fdbaf8bf120343c04a0db51eacca3d4b0ee0b19 /scripts/mod | |
parent | 08a183f02b5fef1cd78d27ffc8281fa96d79f814 (diff) |
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.
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>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/modpost.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 2bd594e6d1b4..9adb667dd31a 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -1494,6 +1494,13 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) | |||
1494 | return 0; | 1494 | return 0; |
1495 | } | 1495 | } |
1496 | 1496 | ||
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 | |||
1497 | static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) | 1504 | static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r) |
1498 | { | 1505 | { |
1499 | unsigned int r_typ = ELF_R_TYPE(r->r_info); | 1506 | 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) | |||
1505 | (elf->symtab_start + ELF_R_SYM(r->r_info)); | 1512 | (elf->symtab_start + ELF_R_SYM(r->r_info)); |
1506 | break; | 1513 | break; |
1507 | case R_ARM_PC24: | 1514 | case R_ARM_PC24: |
1515 | case R_ARM_CALL: | ||
1516 | case R_ARM_JUMP24: | ||
1508 | /* From ARM ABI: ((S + A) | T) - P */ | 1517 | /* From ARM ABI: ((S + A) | T) - P */ |
1509 | r->r_addend = (int)(long)(elf->hdr + | 1518 | r->r_addend = (int)(long)(elf->hdr + |
1510 | sechdr->sh_offset + | 1519 | sechdr->sh_offset + |