Skip to content

Commit c9698e5

Browse files
David A. LongRussell King
authored andcommitted
ARM: 7964/1: Detect section mismatches in thumb relocations
Add processing for normally encountered thumb relocation types so that section mismatches will be detected. Comment from Rusty Russell follows: Happiest for this to go through an ARM tree, so: Signed-off-by: David A. Long <[email protected]> Acked-by: Rusty Russell <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent cd91b2f commit c9698e5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/mod/modpost.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,16 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
15021502
#define R_ARM_JUMP24 29
15031503
#endif
15041504

1505+
#ifndef R_ARM_THM_CALL
1506+
#define R_ARM_THM_CALL 10
1507+
#endif
1508+
#ifndef R_ARM_THM_JUMP24
1509+
#define R_ARM_THM_JUMP24 30
1510+
#endif
1511+
#ifndef R_ARM_THM_JUMP19
1512+
#define R_ARM_THM_JUMP19 51
1513+
#endif
1514+
15051515
static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
15061516
{
15071517
unsigned int r_typ = ELF_R_TYPE(r->r_info);
@@ -1515,6 +1525,9 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
15151525
case R_ARM_PC24:
15161526
case R_ARM_CALL:
15171527
case R_ARM_JUMP24:
1528+
case R_ARM_THM_CALL:
1529+
case R_ARM_THM_JUMP24:
1530+
case R_ARM_THM_JUMP19:
15181531
/* From ARM ABI: ((S + A) | T) - P */
15191532
r->r_addend = (int)(long)(elf->hdr +
15201533
sechdr->sh_offset +

0 commit comments

Comments
 (0)