summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-24 11:37:17 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:32 +0200
commitc5cb40e9fc0b6e17e94c716d75c495e98e593a79 (patch)
tree4dceb33b52aa36f7c516bf37e4269e77a1f4d1b2
parentf9946285cec1137bf5353f904c085bb683dd293b (diff)
ldd.c: reduce size
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r--utils/ldd.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/utils/ldd.c b/utils/ldd.c
index 7ec61a92d..908370dfe 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -144,7 +144,7 @@ static int interpreter_already_found = 0;
static __inline__ uint32_t byteswap32_to_host(uint32_t value)
{
- if (byteswap == 1) {
+ if (byteswap) {
return (bswap_32(value));
} else {
return (value);
@@ -152,7 +152,7 @@ static __inline__ uint32_t byteswap32_to_host(uint32_t value)
}
static __inline__ uint64_t byteswap64_to_host(uint64_t value)
{
- if (byteswap == 1) {
+ if (byteswap) {
return (bswap_64(value));
} else {
return (value);
@@ -231,14 +231,7 @@ static int check_elf_header(ElfW(Ehdr) *const ehdr)
}
/* Check if the target endianness matches the host's endianness */
- byteswap = 0;
- if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_LITTLE) {
- if (ehdr->e_ident[5] == ELFDATA2MSB)
- byteswap = 1;
- } else if (UCLIBC_ENDIAN_HOST == UCLIBC_ENDIAN_BIG) {
- if (ehdr->e_ident[5] == ELFDATA2LSB)
- byteswap = 1;
- }
+ byteswap = (ehdr->e_ident[5] == ELFDATAM) ? 0 : 1;
/* Be very lazy, and only byteswap the stuff we use */
if (byteswap) {