aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-hppa.c
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@netbsd.org>2004-07-27 22:30:25 +0000
committerJason Thorpe <thorpej@netbsd.org>2004-07-27 22:30:25 +0000
commit225247f09fa353923f236db2c1e4c7fea74ac63e (patch)
treeaca12be4ba1a4ae35fcba22ab8a16610efb67a50 /bfd/elf32-hppa.c
parent1bec8141aa331266a162701c3ba0e0ea9bf3b6d5 (diff)
downloadgdb-225247f09fa353923f236db2c1e4c7fea74ac63e.zip
gdb-225247f09fa353923f236db2c1e4c7fea74ac63e.tar.gz
gdb-225247f09fa353923f236db2c1e4c7fea74ac63e.tar.bz2
bfd:
* config.bfd (hppa*-*-netbsd*): Set targ_defvec to bfd_elf32_hppa_nbsd_vec. Add bfd_elf32_hppa_linux_vec to targ_selvecs. * configure.in (bfd_elf32_hppa_nbsd_vec): Add case. * configure: Regenerate. * elf32-hppa.c (elf32_hppa_object_p): Add "elf32-hppa-netbsd" case that accepts OSABI=NetBSD and OSABI=SysV. (elf32_hppa_set_gp): For "elf32-hppa-netbsd", set the GP to the base of .got or .data (if .got does not exist). (elf32_hppa_post_process_headers): For elf32-hppa-netbsd, set OSABI=NetBSD. (TARGET_BIG_SYM): Add bfd_elf32_hppa_nbsd_vec case. (TARGET_BIG_NAME): Add "elf32-hppa-netbsd" case. * targets.c (bfd_elf32_hppa_nbsd_vec): Add extern declaration. (_bfd_target_vector): Add bfd_elf32_hppa_nbsd_vec. gas: * config/tc-hppa.h (TARGET_FORMAT): Set to "elf32-hppa-netbsd" for TE_NetBSD. ld: * emulparams/hppanbsd.sh (OUTPUT_FORMAT): Set to "elf32-hppa-netbsd".
Diffstat (limited to 'bfd/elf32-hppa.c')
-rw-r--r--bfd/elf32-hppa.c33
1 files changed, 28 insertions, 5 deletions
diff --git a/bfd/elf32-hppa.c b/bfd/elf32-hppa.c
index 4c35bbe..67d1f50 100644
--- a/bfd/elf32-hppa.c
+++ b/bfd/elf32-hppa.c
@@ -901,6 +901,14 @@ elf32_hppa_object_p (bfd *abfd)
i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
return FALSE;
}
+ else if (strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") == 0)
+ {
+ /* GCC on hppa-netbsd produces binaries with OSABI=NetBSD,
+ but the kernel produces corefiles with OSABI=SysV. */
+ if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NETBSD &&
+ i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_NONE) /* aka SYSV */
+ return FALSE;
+ }
else
{
if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_HPUX)
@@ -2899,7 +2907,8 @@ elf32_hppa_set_gp (bfd *abfd, struct bfd_link_info *info)
if either the .plt or .got is larger than 0x2000. If both
the .plt and .got are smaller than 0x2000, choose the end of
the .plt section. */
- sec = splt;
+ sec = strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") == 0
+ ? NULL : splt;
if (sec != NULL)
{
gp_val = sec->size;
@@ -2913,10 +2922,13 @@ elf32_hppa_set_gp (bfd *abfd, struct bfd_link_info *info)
sec = sgot;
if (sec != NULL)
{
- /* We know we don't have a .plt. If .got is large,
- offset our LTP. */
- if (sec->size > 0x2000)
- gp_val = 0x2000;
+ if (strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") != 0)
+ {
+ /* We know we don't have a .plt. If .got is large,
+ offset our LTP. */
+ if (sec->size > 0x2000)
+ gp_val = 0x2000;
+ }
}
else
{
@@ -4116,6 +4128,10 @@ elf32_hppa_post_process_headers (bfd *abfd,
{
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
}
+ else if (strcmp (bfd_get_target (abfd), "elf32-hppa-netbsd") == 0)
+ {
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_NETBSD;
+ }
else
{
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX;
@@ -4185,3 +4201,10 @@ elf32_hppa_elf_get_symbol_type (Elf_Internal_Sym *elf_sym, int type)
#define INCLUDED_TARGET_FILE 1
#include "elf32-target.h"
+
+#undef TARGET_BIG_SYM
+#define TARGET_BIG_SYM bfd_elf32_hppa_nbsd_vec
+#undef TARGET_BIG_NAME
+#define TARGET_BIG_NAME "elf32-hppa-netbsd"
+
+#include "elf32-target.h"