[git commit future 1/1] ldd.c: reduce size
Khem Raj
raj.khem at gmail.com
Sat Mar 19 18:51:25 UTC 2011
commit: http://git.uclibc.org/uClibc/commit/?id=cf814547b1f3a637b8487bae590b3b39593cad1a
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future
Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
utils/ldd.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/utils/ldd.c b/utils/ldd.c
index 3858c81..768c3a8 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -137,7 +137,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);
@@ -145,7 +145,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);
@@ -224,14 +224,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) {
--
1.7.3.4
More information about the uClibc-cvs
mailing list