|
@@ -2121,7 +2121,7 @@ static inline void memcpy_fromfs(void * to, const void * from, unsigned long n)
|
|
memcpy(to, from, n);
|
|
memcpy(to, from, n);
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef BSWAP_NEEDED
|
|
|
|
|
|
+#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
|
|
static void bswap_ehdr(struct elfhdr *ehdr)
|
|
static void bswap_ehdr(struct elfhdr *ehdr)
|
|
{
|
|
{
|
|
bswap16s(&ehdr->e_type); /* Object file type */
|
|
bswap16s(&ehdr->e_type); /* Object file type */
|
|
@@ -3143,7 +3143,7 @@ static bool parse_elf_properties(const ImageSource *src,
|
|
* The contents of a valid PT_GNU_PROPERTY is a sequence of uint32_t.
|
|
* The contents of a valid PT_GNU_PROPERTY is a sequence of uint32_t.
|
|
* Swap most of them now, beyond the header and namesz.
|
|
* Swap most of them now, beyond the header and namesz.
|
|
*/
|
|
*/
|
|
-#ifdef BSWAP_NEEDED
|
|
|
|
|
|
+#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
|
|
for (int i = 4; i < n / 4; i++) {
|
|
for (int i = 4; i < n / 4; i++) {
|
|
bswap32s(note.data + i);
|
|
bswap32s(note.data + i);
|
|
}
|
|
}
|
|
@@ -3999,7 +3999,7 @@ struct target_elf_prpsinfo {
|
|
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
|
|
char pr_psargs[ELF_PRARGSZ]; /* initial part of arg list */
|
|
};
|
|
};
|
|
|
|
|
|
-#ifdef BSWAP_NEEDED
|
|
|
|
|
|
+#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
|
|
static void bswap_prstatus(struct target_elf_prstatus *prstatus)
|
|
static void bswap_prstatus(struct target_elf_prstatus *prstatus)
|
|
{
|
|
{
|
|
prstatus->pr_info.si_signo = tswap32(prstatus->pr_info.si_signo);
|
|
prstatus->pr_info.si_signo = tswap32(prstatus->pr_info.si_signo);
|
|
@@ -4038,7 +4038,7 @@ static void bswap_note(struct elf_note *en)
|
|
static inline void bswap_prstatus(struct target_elf_prstatus *p) { }
|
|
static inline void bswap_prstatus(struct target_elf_prstatus *p) { }
|
|
static inline void bswap_psinfo(struct target_elf_prpsinfo *p) {}
|
|
static inline void bswap_psinfo(struct target_elf_prpsinfo *p) {}
|
|
static inline void bswap_note(struct elf_note *en) { }
|
|
static inline void bswap_note(struct elf_note *en) { }
|
|
-#endif /* BSWAP_NEEDED */
|
|
|
|
|
|
+#endif /* HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN */
|
|
|
|
|
|
/*
|
|
/*
|
|
* Calculate file (dump) size of given memory region.
|
|
* Calculate file (dump) size of given memory region.
|