summaryrefslogtreecommitdiff
path: root/elfcpp/elfcpp_swap.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-01 21:25:23 +0000
committerIan Lance Taylor <iant@google.com>2007-10-01 21:25:23 +0000
commit4cdc4e5b1c4b9bf617c1a9dba84f8bf9b604a555 (patch)
tree11711b6286c7191470449741b77b58762738dcf0 /elfcpp/elfcpp_swap.h
parentfa834d65874e27667734fb9e135325a33bef2e1f (diff)
downloadbinutils-redhat-4cdc4e5b1c4b9bf617c1a9dba84f8bf9b604a555.tar.gz
Add Signed_valtype and use it for sign extension. Fix names of rela8.
Diffstat (limited to 'elfcpp/elfcpp_swap.h')
-rw-r--r--elfcpp/elfcpp_swap.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/elfcpp/elfcpp_swap.h b/elfcpp/elfcpp_swap.h
index 24ffccd087..329ed16383 100644
--- a/elfcpp/elfcpp_swap.h
+++ b/elfcpp/elfcpp_swap.h
@@ -53,8 +53,8 @@ struct Endian
};
// Valtype_base is a template based on size (8, 16, 32, 64) which
-// defines the type Valtype as the unsigned integer of the specified
-// size.
+// defines the type Valtype as the unsigned integer, and
+// Signed_valtype as the signed integer, of the specified size.
template<int size>
struct Valtype_base;
@@ -62,25 +62,29 @@ struct Valtype_base;
template<>
struct Valtype_base<8>
{
- typedef unsigned char Valtype;
+ typedef uint8_t Valtype;
+ typedef int8_t Signed_valtype;
};
template<>
struct Valtype_base<16>
{
typedef uint16_t Valtype;
+ typedef int16_t Signed_valtype;
};
template<>
struct Valtype_base<32>
{
typedef uint32_t Valtype;
+ typedef int32_t Signed_valtype;
};
template<>
struct Valtype_base<64>
{
typedef uint64_t Valtype;
+ typedef int64_t Signed_valtype;
};
// Convert_endian is a template based on size and on whether the host