From: Randy Dunlap <randy.dunlap@oracle.com>
To: lkml <linux-kernel@vger.kernel.org>
Cc: akpm <akpm@linux-foundation.org>
Subject: [PATCH -mm] scripts/decodecode: add AFLAGS
Date: Fri, 29 Jun 2007 10:21:08 -0700 [thread overview]
Message-ID: <20070629102108.c4b823bf.randy.dunlap@oracle.com> (raw)
From: Randy Dunlap <randy.dunlap@oracle.com>
Add AFLAGS=options environment variable for the 'as' command.
This enables us to generate code for something other than the host
system architecture. E.g., on an x86_64 system:
AFLAGS=--32 scripts/decodecode < i386.oops
generates code for i386 (and then objdump uses the object file's
arch. to disassemble it).
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
scripts/decodecode | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- linux-2622-rc6mm1.orig/scripts/decodecode
+++ linux-2622-rc6mm1/scripts/decodecode
@@ -1,6 +1,10 @@
#!/bin/sh
# Disassemble the Code: line in Linux oopses
# usage: decodecode < oops.file
+#
+# options: set env. variable AFLAGS=options to pass options to "as";
+# e.g., to decode an i386 oops on an x86_64 system, use:
+# AFLAGS=--32 decodecode < 386.oops
T=`mktemp`
code=
@@ -31,7 +35,7 @@ if [ $marker -ne 0 ]; then
beforemark=`echo "$code" | cut -c-$((${marker} - 1))`
echo -n " .byte 0x" > $T.s
echo $beforemark | sed -e 's/ /,0x/g' >> $T.s
- as -o $T.o $T.s
+ as $AFLAGS -o $T.o $T.s
objdump -S $T.o
rm $T.o $T.s
@@ -42,6 +46,6 @@ fi
code=`echo $code | sed -e 's/ [<(]/ /;s/[>)] / /;s/ /,0x/g'`
echo -n " .byte 0x" > $T.s
echo $code >> $T.s
-as -o $T.o $T.s
+as $AFLAGS -o $T.o $T.s
objdump -S $T.o
rm $T.o $T.s
reply other threads:[~2007-06-29 17:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20070629102108.c4b823bf.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®