From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/1 v2] ARM: Thumb-2: Symbol manipulation macros for function body copying
Date: Fri, 14 Jan 2011 17:43:39 +0000 [thread overview]
Message-ID: <20110114174339.GC22505@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTikiR+XN4Jb9GSEdUUiOciLvxqXB+NA3DEWhNCga@mail.gmail.com>
On Fri, Jan 14, 2011 at 11:15:19AM -0600, Dave Martin wrote:
> There's another problem which I hadn't spotted before:
>
> In the Thumb case, we risk violating the alignment constraints of the
> code which gets copied (actually, this is also true of the ARM case,
> but less likely to bite). This matters because the code may contain
> literals and other data words -- quite likely given the requirement
> for self-containedness.
There's a solution to this - require that the thumb function is
preceded by a .align 3 (which according to the GAS documentation I
have means for ARM, it aligns the PC to 1 << 3 not 3 bytes.)
Also require 8-byte alignment from the allocation function, and make
fncpy() bug if the destination isn't 8-byte aligned. Same for the
source function argument (but ignoring bit 0 of course.)
We don't then have to mess with rounding allocation sizes up, nor worry
about aligning the destination according to the source or any other
games like that.
The down-side is wastage of maybe 7 bytes a function, but that's
probably going to happen anyway.
next prev parent reply other threads:[~2011-01-14 17:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 20:51 [PATCH v2 0/1] ARM: Thumb-2: Symbol manipulation macros for function body copying Dave Martin
2011-01-13 20:51 ` [PATCH 1/1 v2] " Dave Martin
2011-01-13 23:55 ` Russell King - ARM Linux
2011-01-14 15:42 ` Dave Martin
2011-01-14 17:15 ` Dave Martin
2011-01-14 17:43 ` Russell King - ARM Linux [this message]
2011-01-14 17:59 ` Dave Martin
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=20110114174339.GC22505@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).