All of lore.kernel.org
 help / color / mirror / Atom feed
From: taras.kondratiuk@linaro.org (Taras Kondratiuk)
To: linux-arm-kernel@lists.infradead.org
Subject: .align may cause data to be interpreted as instructions
Date: Wed, 16 Oct 2013 23:47:04 +0300	[thread overview]
Message-ID: <525EFB48.40002@linaro.org> (raw)
In-Reply-To: <20131016192512.GB21726@localhost.localdomain>

On 10/16/2013 10:25 PM, Dave Martin wrote:
> Unfortunately, objdump can and does get confused about data/instruction
> boundaries, so the output you see above may be misleading.
> 
> Displaying the symbol table with --special-syms will list the magic
> symbols that mark the instruction and data boundaries, to help debug
> this kind of situation.
> 
> 
> However, in this case, I think you've found a bug in the assembler,
> as shown below.
> 
> Before linking, the final $a symbol (indicating the start of ARM
> instructions) is at address 8, so in this case objdump is correct
> to show 0x12345678 as an instruction.
> 
> After linking, the mapping symbols ($[atd]) remain as before, and
> the linker has byteswapped this "instruction" (as it should).
> 
> This is likely related to the magic for inserting the extensible
> NOP-padding fragment which implements the .align in code sections.
> That is code, and requires a $a mapping symbol, but that somehow
> goes AWOL or gets displaced after the alignment padding ...
> 
> I can't quite get my head around what is going on in
> binutils/gas/config/tc-arm.c.  We would need to understand that
> before we can identify a reliable workaround.

Thanks for confirming the issue.
Does it makes sense to file a GCC bug?

       reply	other threads:[~2013-10-16 20:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20131016192512.GB21726@localhost.localdomain>
2013-10-16 20:47 ` Taras Kondratiuk [this message]
2013-10-16 21:17   ` .align may cause data to be interpreted as instructions Måns Rullgård
     [not found] <20131017125533.GD2442@localhost.localdomain>
2013-10-18 11:03 ` Jon Medhurst (Tixy)
2013-10-18 12:36   ` Taras Kondratiuk
2013-10-15 22:38 Taras Kondratiuk
2013-10-16 11:13 ` Ben Dooks
2013-10-16 16:06   ` Jon Medhurst (Tixy)
2013-10-16 17:03     ` Jon Medhurst (Tixy)
2013-10-16 21:16       ` Taras Kondratiuk
2013-10-16 15:28 ` Jon Medhurst (Tixy)
2013-10-17 12:17 ` Jon Medhurst (Tixy)
2013-10-17 18:09   ` Taras Kondratiuk

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=525EFB48.40002@linaro.org \
    --to=taras.kondratiuk@linaro.org \
    --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.