haven't bothered yet.
*/
-#ifdef __sparcv9
-#define _SYSCALL32 /* For Sparc64-cross-32 */
-#endif
-
+/* For sparc64-cross-sparc32. */
+#define _SYSCALL32
#include "bfd.h"
#include "sysdep.h"
#include "bfdlink.h"
if (name == NULL)
{
- name = symbol->name;
+ name = symbol->name;
bfd_print_symbol_vandf ((PTR) file, symbol);
}
}
void
-_bfd_elf_link_hash_hide_symbol(info, h)
+_bfd_elf_link_hash_hide_symbol (info, h)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
struct elf_link_hash_entry *h;
{
char* name;
asection* sect;
int raw_size;
+ int offset;
if (note->descsz == sizeof (prstatus_t))
{
prstatus_t prstat;
raw_size = sizeof (prstat.pr_reg);
+ offset = offsetof (prstatus_t, pr_reg);
memcpy (&prstat, note->descdata, sizeof (prstat));
elf_tdata (abfd)->core_signal = prstat.pr_cursig;
elf_tdata (abfd)->core_lwpid = prstat.pr_who;
#endif
}
-#if defined (__sparcv9)
+#if defined (HAVE_PRSTATUS32_T)
else if (note->descsz == sizeof (prstatus32_t))
{
/* 64-bit host, 32-bit corefile */
prstatus32_t prstat;
raw_size = sizeof (prstat.pr_reg);
+ offset = offsetof (prstatus32_t, pr_reg);
memcpy (&prstat, note->descdata, sizeof (prstat));
elf_tdata (abfd)->core_signal = prstat.pr_cursig;
pr_who doesn't exist on:
linux 2.[01]
*/
-#if defined (HAVE_PRSTATUS_T_PR_WHO)
+#if defined (HAVE_PRSTATUS32_T_PR_WHO)
elf_tdata (abfd)->core_lwpid = prstat.pr_who;
#endif
}
-#endif /* __sparcv9 */
+#endif /* HAVE_PRSTATUS32_T */
else
{
/* Fail - we don't know how to handle any other
if (sect == NULL)
return false;
- if (note->descsz == sizeof (prstatus_t))
- {
- sect->_raw_size = raw_size;
- sect->filepos = note->descpos + offsetof (prstatus_t, pr_reg);
- }
-#if defined (__sparcv9)
- else if (note->descsz == sizeof (prstatus32_t))
- {
- sect->_raw_size = raw_size;
- sect->filepos = note->descpos + offsetof (prstatus32_t, pr_reg);
- }
-#endif
+ sect->_raw_size = raw_size;
+ sect->filepos = note->descpos + offset;
sect->flags = SEC_HAS_CONTENTS;
sect->alignment_power = 2;
#if defined (HAVE_PRPSINFO_T)
typedef prpsinfo_t elfcore_psinfo_t;
-#if defined (__sparcv9) /* Sparc64 cross Sparc32 */
+#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */
typedef prpsinfo32_t elfcore_psinfo32_t;
#endif
#endif
#if defined (HAVE_PSINFO_T)
typedef psinfo_t elfcore_psinfo_t;
-#if defined (__sparcv9) /* Sparc64 cross Sparc32 */
+#if defined (HAVE_PSINFO32_T) /* Sparc64 cross Sparc32 */
typedef psinfo32_t elfcore_psinfo32_t;
#endif
#endif
{
elfcore_psinfo_t psinfo;
- memcpy (&psinfo, note->descdata, note->descsz);
+ memcpy (&psinfo, note->descdata, sizeof (psinfo));
elf_tdata (abfd)->core_program
= elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname));
elf_tdata (abfd)->core_command
= elfcore_strndup (abfd, psinfo.pr_psargs, sizeof (psinfo.pr_psargs));
}
-#if defined (__sparcv9)
+#if defined (HAVE_PRPSINFO32_T) || defined (HAVE_PSINFO32_T)
else if (note->descsz == sizeof (elfcore_psinfo32_t))
{
/* 64-bit host, 32-bit corefile */
elfcore_psinfo32_t psinfo;
- memcpy (&psinfo, note->descdata, note->descsz);
+ memcpy (&psinfo, note->descdata, sizeof (psinfo));
elf_tdata (abfd)->core_program
= elfcore_strndup (abfd, psinfo.pr_fname, sizeof (psinfo.pr_fname));
elf_tdata (abfd)->core_pid = pstat.pr_pid;
}
-#if defined (__sparcv9)
+#if defined (HAVE_PSTATUS32_T)
else if (note->descsz == sizeof (pstatus32_t))
{
/* 64-bit host, 32-bit corefile */