Integrate / parameterize changes from Chuq Silvers / Nick Hudson to
simplify GP handling on HPPA for NetBSD, and get dynamically-linked executables working. Changes to be submitted to FSF: 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.in: 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:
parent
a3f3869414
commit
eb9f224468
6
gnu/dist/binutils/bfd/config.bfd
vendored
6
gnu/dist/binutils/bfd/config.bfd
vendored
@ -351,10 +351,14 @@ case "${targ}" in
|
||||
;;
|
||||
#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
|
||||
|
1
gnu/dist/binutils/bfd/configure
vendored
1
gnu/dist/binutils/bfd/configure
vendored
@ -6119,6 +6119,7 @@ do
|
||||
bfd_elf32_frv_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" ;;
|
||||
|
1
gnu/dist/binutils/bfd/configure.in
vendored
1
gnu/dist/binutils/bfd/configure.in
vendored
@ -581,6 +581,7 @@ do
|
||||
bfd_elf32_frv_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" ;;
|
||||
|
33
gnu/dist/binutils/bfd/elf32-hppa.c
vendored
33
gnu/dist/binutils/bfd/elf32-hppa.c
vendored
@ -1064,6 +1064,14 @@ elf32_hppa_object_p (abfd)
|
||||
if (i_ehdrp->e_ident[EI_OSABI] != ELFOSABI_LINUX)
|
||||
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)
|
||||
@ -3183,7 +3191,8 @@ elf32_hppa_set_gp (abfd, 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->_raw_size;
|
||||
@ -3197,10 +3206,13 @@ elf32_hppa_set_gp (abfd, info)
|
||||
sec = sgot;
|
||||
if (sec != NULL)
|
||||
{
|
||||
/* We know we don't have a .plt. If .got is large,
|
||||
offset our LTP. */
|
||||
if (sec->_raw_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->_raw_size > 0x2000)
|
||||
gp_val = 0x2000;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4378,6 +4390,10 @@ elf32_hppa_post_process_headers (abfd, link_info)
|
||||
{
|
||||
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;
|
||||
@ -4450,3 +4466,10 @@ elf32_hppa_elf_get_symbol_type (elf_sym, 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"
|
||||
|
2
gnu/dist/binutils/bfd/targets.c
vendored
2
gnu/dist/binutils/bfd/targets.c
vendored
@ -523,6 +523,7 @@ extern const bfd_target bfd_elf32_fr30_vec;
|
||||
extern const bfd_target bfd_elf32_frv_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;
|
||||
@ -811,6 +812,7 @@ static const bfd_target * const _bfd_target_vector[] = {
|
||||
&bfd_elf32_frv_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,
|
||||
|
6
gnu/dist/binutils/gas/config/tc-hppa.h
vendored
6
gnu/dist/binutils/gas/config/tc-hppa.h
vendored
@ -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"
|
||||
|
2
gnu/dist/binutils/ld/emulparams/hppanbsd.sh
vendored
2
gnu/dist/binutils/ld/emulparams/hppanbsd.sh
vendored
@ -2,3 +2,5 @@
|
||||
# hppaobsd.sh
|
||||
|
||||
. ${srcdir}/emulparams/hppalinux.sh
|
||||
|
||||
OUTPUT_FORMAT="elf32-hppa-netbsd"
|
||||
|
Loading…
Reference in New Issue
Block a user