diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-08-22 11:36:30 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-08-22 11:42:08 -0500 |
commit | d329a4202e1f4a8b3283e31e2dfb5a838c49796e (patch) | |
tree | e6f7f146c2b39d0c256c1ec19d06ea8e72e70191 /src | |
parent | 2935ed01dae82a91c1bb4c181fd36cc42b2efaf9 (diff) | |
download | talos-hostboot-d329a4202e1f4a8b3283e31e2dfb5a838c49796e.tar.gz talos-hostboot-d329a4202e1f4a8b3283e31e2dfb5a838c49796e.zip |
Fix gensyms endianness on pool machines.
Change-Id: Iefcc0f963f68cccfcde03d5b0dcec3c00d8399c2
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/269
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/build/tools/gensyms | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/build/tools/gensyms b/src/build/tools/gensyms index 75242c15b..015c39d40 100755 --- a/src/build/tools/gensyms +++ b/src/build/tools/gensyms @@ -4,6 +4,8 @@ use strict; use IO::Seekable; +my $littleendian = (unpack("L", pack("N", 0xabcd1234)) != 0xabcd1234); + sub add_image_subdir { my $image = shift; @@ -80,9 +82,16 @@ foreach my $module (@modules) { seek IMAGE, ($address - $image_offset), SEEK_SET; read IMAGE, $code_loc, 8; - $code_loc = unpack("Q>", $code_loc) + $image_offset; - - my $tmp = $code_loc; $code_loc = $address; $address = $tmp; + if ($littleendian) + { + $code_loc = unpack("Q", reverse($code_loc)) + $image_offset; + } + else + { + $code_loc = unpack("Q", $code_loc) + $image_offset; + } + + my $tmp = $code_loc; $code_loc = $address; $address = $tmp; } my $outstring = ""; $outstring = sprintf "%s,%08x,%08x,%08x,%s\n", ($is_function?"F":"V"),$address,$code_loc,$size,$name; |