forked from Imagelibrary/binutils-gdb
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".
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user