Index: bfd/config.bfd =================================================================== RCS file: /cvs/src/src/bfd/config.bfd,v retrieving revision 1.167 diff -u -r1.167 config.bfd --- bfd/config.bfd 9 Jul 2004 12:32:35 -0000 1.167 +++ bfd/config.bfd 20 Jul 2004 22:46:30 -0000 @@ -384,10 +384,14 @@ ;; #endif - hppa*-*-linux-gnu* | hppa*-*-netbsd*) + hppa*-*-linux-gnu*) targ_defvec=bfd_elf32_hppa_linux_vec targ_selvecs=bfd_elf32_hppa_vec ;; + hppa*-*-netbsd*) + targ_defvec=bfd_elf32_hppa_nbsd_vec + targ_selvecs="bfd_elf32_hppa_vec bfd_elf32_hppa_linux_vec" + ;; hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems* | hppa*-*-openbsd*) targ_defvec=bfd_elf32_hppa_vec targ_selvecs=bfd_elf32_hppa_linux_vec Index: bfd/configure.in =================================================================== RCS file: /cvs/src/src/bfd/configure.in,v retrieving revision 1.157 diff -u -r1.157 configure.in --- bfd/configure.in 7 Jul 2004 17:28:45 -0000 1.157 +++ bfd/configure.in 20 Jul 2004 22:46:37 -0000 @@ -598,6 +598,7 @@ 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" ;; Index: bfd/elf32-hppa.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-hppa.c,v retrieving revision 1.117 diff -u -r1.117 elf32-hppa.c --- bfd/elf32-hppa.c 24 Jun 2004 04:46:19 -0000 1.117 +++ bfd/elf32-hppa.c 20 Jul 2004 22:46:40 -0000 @@ -901,6 +901,14 @@ 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 @@ 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 @@ 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 @@ { 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 @@ #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" Index: bfd/targets.c =================================================================== RCS file: /cvs/src/src/bfd/targets.c,v retrieving revision 1.113 diff -u -r1.113 targets.c --- bfd/targets.c 7 Jul 2004 17:28:46 -0000 1.113 +++ bfd/targets.c 20 Jul 2004 22:46:41 -0000 @@ -541,6 +541,7 @@ 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; @@ -836,6 +837,7 @@ &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, Index: gas/config/tc-hppa.h =================================================================== RCS file: /cvs/src/src/gas/config/tc-hppa.h,v retrieving revision 1.25 diff -u -r1.25 tc-hppa.h --- gas/config/tc-hppa.h 6 Oct 2003 11:01:36 -0000 1.25 +++ gas/config/tc-hppa.h 20 Jul 2004 22:46:42 -0000 @@ -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" Index: ld/emulparams/hppanbsd.sh =================================================================== RCS file: /cvs/src/src/ld/emulparams/hppanbsd.sh,v retrieving revision 1.3 diff -u -r1.3 hppanbsd.sh --- ld/emulparams/hppanbsd.sh 6 Oct 2003 11:01:36 -0000 1.3 +++ ld/emulparams/hppanbsd.sh 20 Jul 2004 22:46:46 -0000 @@ -3,3 +3,4 @@ . ${srcdir}/emulparams/hppalinux.sh +OUTPUT_FORMAT="elf32-hppa-netbsd"