summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-12-01 13:24:51 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-12-06 16:14:14 -0600
commit6a169ffdcc62a48667bb3c22b7547b019dd7e1bf (patch)
treee08efaeb66dacf90bb7b09c7562cab39c544c93b
parent7799749ee2db86f4fb66c4a7a69fb9fb0b46334e (diff)
downloadtalos-hostboot-6a169ffdcc62a48667bb3c22b7547b019dd7e1bf.tar.gz
talos-hostboot-6a169ffdcc62a48667bb3c22b7547b019dd7e1bf.zip
Parse extended image in gensyms.
Change-Id: Ifd9bed08820ce060aad741dedd027520af3e0b89 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/563 Tested-by: Jenkins Server Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--config.mk2
-rwxr-xr-xsrc/build/tools/gensyms52
2 files changed, 47 insertions, 7 deletions
diff --git a/config.mk b/config.mk
index c589f11d0..7436bab41 100644
--- a/config.mk
+++ b/config.mk
@@ -207,7 +207,7 @@ ${IMGDIR}/%.bin ${IMGDIR}/%.list ${IMGDIR}/%.syms: ${IMGDIR}/%.elf \
> ${IMGDIR}/.$*.lnkout
${ROOTPATH}/src/build/tools/addimgid $@ $<
(cd ${ROOTPATH}; \
- src/build/tools/gensyms $*.bin > ./img/$*.syms ; \
+ src/build/tools/gensyms $*.bin $*_extended.bin 0x40000000 > ./img/$*.syms ; \
src/build/tools/genlist $*.bin > ./img/$*.list)
diff --git a/src/build/tools/gensyms b/src/build/tools/gensyms
index 015c39d40..f6f3911d0 100755
--- a/src/build/tools/gensyms
+++ b/src/build/tools/gensyms
@@ -1,4 +1,26 @@
#!/usr/bin/perl
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
+#
+# $Source: src/build/tools/gensyms $
+#
+# IBM CONFIDENTIAL
+#
+# COPYRIGHT International Business Machines Corp. 2011
+#
+# p1
+#
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
+#
+# The source code for this program is not published or other-
+# wise divested of its trade secrets, irrespective of what has
+# been deposited with the U.S. Copyright Office.
+#
+# Origin: 30
+#
+# IBM_PROLOG_END
use strict;
@@ -18,25 +40,33 @@ if (not $image_offset) { $image_offset = "0x0"; };
$image_offset = hex $image_offset;
my $image;
+my $extimage;
+my $extoffset;
my $all_modules = 0;
my @modules = ();
-if ($#ARGV == -1)
+if ($#ARGV <= 1)
{
- die "gensyms <image> [modules]\n";
+ die "gensyms <image> <extimage> <extoffset> [modules]\n";
}
-if ($#ARGV == 0)
+
+if ($#ARGV == 2)
{
$all_modules = 1;
}
else
{
- @modules = @ARGV[1..$#ARGV];
+ @modules = @ARGV[3..$#ARGV];
}
+my $extoffset = hex $ARGV[2];
+
$image = add_image_subdir($ARGV[0]);
open IMAGE, "< $image";
binmode(IMAGE);
+$extimage = add_image_subdir($ARGV[1]);
+open EXTIMAGE, "< $extimage";
+binmode(EXTIMAGE);
my %module_offsets = ();
open MODINFO, "< $image.modinfo";
@@ -80,8 +110,17 @@ foreach my $module (@modules)
my $code_loc = 0;
if ($is_function)
{
- seek IMAGE, ($address - $image_offset), SEEK_SET;
- read IMAGE, $code_loc, 8;
+ if (($address - $image_offset) > $extoffset)
+ {
+ seek EXTIMAGE,
+ ($address - ($image_offset + $extoffset)), SEEK_SET;
+ read EXTIMAGE, $code_loc, 8;
+ }
+ else
+ {
+ seek IMAGE, ($address - $image_offset), SEEK_SET;
+ read IMAGE, $code_loc, 8;
+ }
if ($littleendian)
{
$code_loc = unpack("Q", reverse($code_loc)) + $image_offset;
@@ -102,6 +141,7 @@ foreach my $module (@modules)
}
close IMAGE;
+close EXTIMAGE;
foreach my $outstring (sort { substr($a,2) cmp substr($b,2) } @output)
{
OpenPOWER on IntegriCloud