All of lore.kernel.org
 help / color / mirror / Atom feed
From: rusty@rustcorp.com.au (Rusty Russell)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Detect section mismatches in thumb relocations
Date: Sat, 01 Feb 2014 21:23:16 +1030	[thread overview]
Message-ID: <8738k35ckj.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1391193193-28572-1-git-send-email-dave.long@linaro.org>

David Long <dave.long@linaro.org> writes:
> From: "David A. Long" <dave.long@linaro.org>
>
> Add processing for normally encountered thumb relocation types so that
> section mismatches will be detected.
>
> Signed-off-by: David A. Long <dave.long@linaro.org>

Happiest for this to go through an ARM tree, so:

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Cheers,
Rusty.

> ---
>  scripts/mod/modpost.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 1785576..9e6c996 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -1498,6 +1498,16 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
>  #define R_ARM_JUMP24	29
>  #endif
>  
> +#ifndef	R_ARM_THM_CALL
> +#define	R_ARM_THM_CALL		10
> +#endif
> +#ifndef	R_ARM_THM_JUMP24
> +#define	R_ARM_THM_JUMP24	30
> +#endif
> +#ifndef	R_ARM_THM_JUMP19
> +#define	R_ARM_THM_JUMP19	51
> +#endif
> +
>  static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
>  {
>  	unsigned int r_typ = ELF_R_TYPE(r->r_info);
> @@ -1511,6 +1521,9 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
>  	case R_ARM_PC24:
>  	case R_ARM_CALL:
>  	case R_ARM_JUMP24:
> +	case R_ARM_THM_CALL:
> +	case R_ARM_THM_JUMP24:
> +	case R_ARM_THM_JUMP19:
>  		/* From ARM ABI: ((S + A) | T) - P */
>  		r->r_addend = (int)(long)(elf->hdr +
>  		              sechdr->sh_offset +
> -- 
> 1.8.1.2

WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: David Long <dave.long@linaro.org>, linux-arm-kernel@lists.infradead.org
Cc: James Hogan <james.hogan@imgtec.com>,
	Andi Kleen <ak@linux.intel.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Detect section mismatches in thumb relocations
Date: Sat, 01 Feb 2014 21:23:16 +1030	[thread overview]
Message-ID: <8738k35ckj.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1391193193-28572-1-git-send-email-dave.long@linaro.org>

David Long <dave.long@linaro.org> writes:
> From: "David A. Long" <dave.long@linaro.org>
>
> Add processing for normally encountered thumb relocation types so that
> section mismatches will be detected.
>
> Signed-off-by: David A. Long <dave.long@linaro.org>

Happiest for this to go through an ARM tree, so:

Acked-by: Rusty Russell <rusty@rustcorp.com.au>

Cheers,
Rusty.

> ---
>  scripts/mod/modpost.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 1785576..9e6c996 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -1498,6 +1498,16 @@ static int addend_386_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
>  #define R_ARM_JUMP24	29
>  #endif
>  
> +#ifndef	R_ARM_THM_CALL
> +#define	R_ARM_THM_CALL		10
> +#endif
> +#ifndef	R_ARM_THM_JUMP24
> +#define	R_ARM_THM_JUMP24	30
> +#endif
> +#ifndef	R_ARM_THM_JUMP19
> +#define	R_ARM_THM_JUMP19	51
> +#endif
> +
>  static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
>  {
>  	unsigned int r_typ = ELF_R_TYPE(r->r_info);
> @@ -1511,6 +1521,9 @@ static int addend_arm_rel(struct elf_info *elf, Elf_Shdr *sechdr, Elf_Rela *r)
>  	case R_ARM_PC24:
>  	case R_ARM_CALL:
>  	case R_ARM_JUMP24:
> +	case R_ARM_THM_CALL:
> +	case R_ARM_THM_JUMP24:
> +	case R_ARM_THM_JUMP19:
>  		/* From ARM ABI: ((S + A) | T) - P */
>  		r->r_addend = (int)(long)(elf->hdr +
>  		              sechdr->sh_offset +
> -- 
> 1.8.1.2

  reply	other threads:[~2014-02-01 10:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 18:33 [PATCH] Detect section mismatches in thumb relocations David Long
2014-01-31 18:33 ` David Long
2014-02-01 10:53 ` Rusty Russell [this message]
2014-02-01 10:53   ` Rusty Russell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8738k35ckj.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.