* 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:
Jason Thorpe 2004-07-27 22:30:25 +00:00
parent 1bec8141aa
commit 225247f09f
7 changed files with 347 additions and 309 deletions

View file

@ -1,3 +1,20 @@
2004-07-27 Jason Thorpe <thorpej@wasabisystems.com>
* 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.
2004-07-27 H.J. Lu <hongjiu.lu@intel.com>
PR 161/251

588
bfd/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -598,6 +598,7 @@ do
bfd_elf32_frvfdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;;
bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;;
bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_hppa_nbsd_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;

View file

@ -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;
@ -2912,12 +2921,15 @@ elf32_hppa_set_gp (bfd *abfd, struct bfd_link_info *info)
{
sec = sgot;
if (sec != NULL)
{
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
{
/* No .plt or .got. Who cares what the LTP is? */
@ -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"

View file

@ -546,6 +546,7 @@ extern const bfd_target bfd_elf32_frv_vec;
extern const bfd_target bfd_elf32_frvfdpic_vec;
extern const bfd_target bfd_elf32_h8300_vec;
extern const bfd_target bfd_elf32_hppa_linux_vec;
extern const bfd_target bfd_elf32_hppa_nbsd_vec;
extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_freebsd_vec;
@ -841,6 +842,7 @@ static const bfd_target * const _bfd_target_vector[] = {
&bfd_elf32_frvfdpic_vec,
&bfd_elf32_h8300_vec,
&bfd_elf32_hppa_linux_vec,
&bfd_elf32_hppa_nbsd_vec,
&bfd_elf32_hppa_vec,
&bfd_elf32_i370_vec,
&bfd_elf32_i386_freebsd_vec,

View file

@ -55,13 +55,17 @@
#endif
#else /* TARGET_ARCH_SIZE == 32 */
#include "bfd/elf32-hppa.h"
#if defined (TE_LINUX) || defined (TE_NetBSD)
#if defined (TE_LINUX)
#define TARGET_FORMAT "elf32-hppa-linux"
#else
#if defined (TE_NetBSD)
#define TARGET_FORMAT "elf32-hppa-netbsd"
#else
#define TARGET_FORMAT "elf32-hppa"
#endif
#endif
#endif
#endif
#ifdef OBJ_SOM
#include "bfd/som.h"

View file

@ -3,3 +3,4 @@
. ${srcdir}/emulparams/hppalinux.sh
OUTPUT_FORMAT="elf32-hppa-netbsd"