Linux target variants for elfxx-hppa.

This commit is contained in:
Alan Modra 2001-01-14 11:12:53 +00:00
parent ffd6e9debc
commit d952f17a9d
9 changed files with 193 additions and 114 deletions

View File

@ -1,5 +1,19 @@
2001-01-14 Alan Modra <alan@linuxcare.com.au> 2001-01-14 Alan Modra <alan@linuxcare.com.au>
* config.bfd: Add linux target variant for elfxx-hppa.
* configure.in: Recognize bfd_elf32_hppa_linux_vec and
bfd_elf64_hppa_linux_vec.
* configure: Regenerate.
* elf64-hppa.c: Include elf64-target.h again to support linux
target variant.
(elf64_hppa_post_process_headers): Set ELFOSABI_LINUX for linux.
* elf32-hppa.c: Include elf32-target.h again to support linux
target variant.
(elf32_hppa_post_process_headers): New function.
(elf_backend_post_process_headers): Define.
* targets.c (bfd_target_vector): Add bfd_elf64_hppa_linux_vec and
bfd_elf32_hppa_linux_vec.
* elf32-hppa.c (elf32_hppa_link_hash_table): Add text_segment_base, * elf32-hppa.c (elf32_hppa_link_hash_table): Add text_segment_base,
and data_segment_base fields. and data_segment_base fields.
(elf32_hppa_link_hash_table_create ): Init them. (elf32_hppa_link_hash_table_create ): Init them.

View File

@ -257,16 +257,23 @@ case "${targ}" in
#ifdef BFD64 #ifdef BFD64
hppa*64*-*-linux-gnu*) hppa*64*-*-linux-gnu*)
targ_defvec=bfd_elf64_hppa_vec targ_defvec=bfd_elf64_hppa_linux_vec
targ_selvecs=bfd_elf64_hppa_vec
;; ;;
hppa*64*-*-hpux11*) hppa*64*-*-hpux11*)
targ_defvec=bfd_elf64_hppa_vec targ_defvec=bfd_elf64_hppa_vec
targ_selvecs=bfd_elf64_hppa_linux_vec
targ_cflags=-DHPUX_LARGE_AR_IDS targ_cflags=-DHPUX_LARGE_AR_IDS
;; ;;
#endif #endif
hppa*-*-*elf* | hppa*-*-linux-gnu* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*) hppa*-*-linux-gnu*)
targ_defvec=bfd_elf32_hppa_linux_vec
targ_selvecs=bfd_elf32_hppa_vec
;;
hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems*)
targ_defvec=bfd_elf32_hppa_vec targ_defvec=bfd_elf32_hppa_vec
targ_selvecs=bfd_elf32_hppa_linux_vec
;; ;;
#if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX) #if defined (HOST_HPPAHPUX) || defined (HOST_HPPABSD) || defined (HOST_HPPAOSF) || defined (HOST_HPPAMPEIX)

30
bfd/configure vendored
View File

@ -5932,7 +5932,8 @@ do
target64=true ;; target64=true ;;
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
target64=true ;; target64=true ;;
bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf" bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec)
tb="$tb elf64-hppa.lo elf64.lo $elf"
target64=true ;; target64=true ;;
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"
target64=true ;; target64=true ;;
@ -5955,7 +5956,8 @@ do
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec)
tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"
@ -6177,17 +6179,17 @@ for ac_hdr in unistd.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6181: checking for $ac_hdr" >&5 echo "configure:6183: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6186 "configure" #line 6188 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6191: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:6193: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -6216,12 +6218,12 @@ done
for ac_func in getpagesize for ac_func in getpagesize
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6220: checking for $ac_func" >&5 echo "configure:6222: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6225 "configure" #line 6227 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -6244,7 +6246,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:6248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:6250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else
@ -6269,7 +6271,7 @@ fi
done done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
echo "configure:6273: checking for working mmap" >&5 echo "configure:6275: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
@ -6277,7 +6279,7 @@ else
ac_cv_func_mmap_fixed_mapped=no ac_cv_func_mmap_fixed_mapped=no
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6281 "configure" #line 6283 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test. /* Thanks to Mike Haertel and Jim Avera for this test.
@ -6417,7 +6419,7 @@ main()
} }
EOF EOF
if { (eval echo configure:6421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:6423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_mmap_fixed_mapped=yes
else else
@ -6442,12 +6444,12 @@ fi
for ac_func in madvise mprotect for ac_func in madvise mprotect
do do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6446: checking for $ac_func" >&5 echo "configure:6448: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6451 "configure" #line 6453 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */ which can conflict with char $ac_func(); below. */
@ -6470,7 +6472,7 @@ $ac_func();
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:6474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:6476: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_func_$ac_func=yes" eval "ac_cv_func_$ac_func=yes"
else else

View File

@ -481,7 +481,8 @@ do
target64=true ;; target64=true ;;
bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf" bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"
target64=true ;; target64=true ;;
bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf" bfd_elf64_hppa_vec | bfd_elf64_hppa_linux_vec)
tb="$tb elf64-hppa.lo elf64.lo $elf"
target64=true ;; target64=true ;;
bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf" bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"
target64=true ;; target64=true ;;
@ -504,7 +505,8 @@ do
bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;; bfd_elf32_d10v_vec) tb="$tb elf32-d10v.lo elf32.lo $elf" ;;
bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;; bfd_elf32_d30v_vec) tb="$tb elf32-d30v.lo elf32.lo $elf" ;;
bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;;
bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_hppa_vec | bfd_elf32_hppa_linux_vec)
tb="$tb elf32-hppa.lo elf32.lo $elf" ;;
bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;;
bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;;
bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf" bfd_elf64_x86_64_vec) tb="$tb elf64-x86-64.lo elf64.lo $elf"

View File

@ -399,6 +399,9 @@ static boolean elf32_hppa_finish_dynamic_symbol
static boolean elf32_hppa_finish_dynamic_sections static boolean elf32_hppa_finish_dynamic_sections
PARAMS ((bfd *, struct bfd_link_info *)); PARAMS ((bfd *, struct bfd_link_info *));
static void elf32_hppa_post_process_headers
PARAMS ((bfd *, struct bfd_link_info *));
static int elf32_hppa_elf_get_symbol_type static int elf32_hppa_elf_get_symbol_type
PARAMS ((Elf_Internal_Sym *, int)); PARAMS ((Elf_Internal_Sym *, int));
@ -4233,6 +4236,27 @@ elf32_hppa_finish_dynamic_sections (output_bfd, info)
return true; return true;
} }
/* Tweak the OSABI field of the elf header. */
static void
elf32_hppa_post_process_headers (abfd, link_info)
bfd *abfd;
struct bfd_link_info *link_info ATTRIBUTE_UNUSED;
{
Elf_Internal_Ehdr * i_ehdrp;
i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0)
{
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
}
else
{
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX;
}
}
/* Called when writing out an object file to decide the type of a /* Called when writing out an object file to decide the type of a
symbol. */ symbol. */
static int static int
@ -4269,6 +4293,7 @@ elf32_hppa_elf_get_symbol_type (elf_sym, type)
#define elf_backend_gc_sweep_hook elf32_hppa_gc_sweep_hook #define elf_backend_gc_sweep_hook elf32_hppa_gc_sweep_hook
#define elf_backend_object_p elf32_hppa_object_p #define elf_backend_object_p elf32_hppa_object_p
#define elf_backend_final_write_processing elf_hppa_final_write_processing #define elf_backend_final_write_processing elf_hppa_final_write_processing
#define elf_backend_post_process_headers elf32_hppa_post_process_headers
#define elf_backend_get_symbol_type elf32_hppa_elf_get_symbol_type #define elf_backend_get_symbol_type elf32_hppa_elf_get_symbol_type
#define elf_backend_can_gc_sections 1 #define elf_backend_can_gc_sections 1
@ -4285,3 +4310,11 @@ elf32_hppa_elf_get_symbol_type (elf_sym, type)
#define ELF_MAXPAGESIZE 0x1000 #define ELF_MAXPAGESIZE 0x1000
#include "elf32-target.h" #include "elf32-target.h"
#undef TARGET_BIG_SYM
#define TARGET_BIG_SYM bfd_elf32_hppa_linux_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf32-hppa-linux"
#define INCLUDED_TARGET_FILE 1
#include "elf32-target.h"

View File

@ -1166,8 +1166,15 @@ elf64_hppa_post_process_headers (abfd, link_info)
i_ehdrp = elf_elfheader (abfd); i_ehdrp = elf_elfheader (abfd);
if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0)
{
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
}
else
{
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX;
i_ehdrp->e_ident[EI_ABIVERSION] = 1; i_ehdrp->e_ident[EI_ABIVERSION] = 1;
}
} }
/* Create function descriptor section (.opd). This section is called .opd /* Create function descriptor section (.opd). This section is called .opd
@ -2657,3 +2664,11 @@ const struct elf_size_info hppa64_elf_size_info =
#define elf_backend_type_change_ok true #define elf_backend_type_change_ok true
#include "elf64-target.h" #include "elf64-target.h"
#undef TARGET_BIG_SYM
#define TARGET_BIG_SYM bfd_elf64_hppa_linux_vec
#undef TARGET_BIG_NAME
#define TARGET_BIG_NAME "elf64-hppa-linux"
#define INCLUDED_TARGET_FILE 1
#include "elf64-target.h"

View File

@ -1,5 +1,5 @@
/* Generic target-file-type support for the BFD library. /* Generic target-file-type support for the BFD library.
Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc. Free Software Foundation, Inc.
Written by Cygnus Support. Written by Cygnus Support.
@ -508,6 +508,7 @@ extern const bfd_target bfd_efi_app_ia32_vec;
extern const bfd_target bfd_efi_app_ia64_vec; extern const bfd_target bfd_efi_app_ia64_vec;
extern const bfd_target bfd_elf64_alpha_vec; extern const bfd_target bfd_elf64_alpha_vec;
extern const bfd_target bfd_elf64_hppa_vec; extern const bfd_target bfd_elf64_hppa_vec;
extern const bfd_target bfd_elf64_hppa_linux_vec;
extern const bfd_target bfd_elf64_ia64_little_vec; extern const bfd_target bfd_elf64_ia64_little_vec;
extern const bfd_target bfd_elf64_ia64_big_vec; extern const bfd_target bfd_elf64_ia64_big_vec;
extern const bfd_target bfd_elf32_ia64_big_vec; extern const bfd_target bfd_elf32_ia64_big_vec;
@ -526,6 +527,7 @@ extern const bfd_target bfd_elf32_us_cris_vec;
extern const bfd_target bfd_elf32_d10v_vec; extern const bfd_target bfd_elf32_d10v_vec;
extern const bfd_target bfd_elf32_d30v_vec; extern const bfd_target bfd_elf32_d30v_vec;
extern const bfd_target bfd_elf32_hppa_vec; extern const bfd_target bfd_elf32_hppa_vec;
extern const bfd_target bfd_elf32_hppa_linux_vec;
extern const bfd_target bfd_elf32_i370_vec; extern const bfd_target bfd_elf32_i370_vec;
extern const bfd_target bfd_elf32_i386_vec; extern const bfd_target bfd_elf32_i386_vec;
extern const bfd_target bfd_elf32_i860_vec; extern const bfd_target bfd_elf32_i860_vec;
@ -719,6 +721,7 @@ const bfd_target * const bfd_target_vector[] = {
#ifdef BFD64 #ifdef BFD64
&bfd_elf64_alpha_vec, &bfd_elf64_alpha_vec,
&bfd_elf64_hppa_vec, &bfd_elf64_hppa_vec,
&bfd_elf64_hppa_linux_vec,
&bfd_elf64_ia64_little_vec, &bfd_elf64_ia64_little_vec,
&bfd_elf64_ia64_big_vec, &bfd_elf64_ia64_big_vec,
#endif #endif
@ -735,6 +738,7 @@ const bfd_target * const bfd_target_vector[] = {
&bfd_elf32_d10v_vec, &bfd_elf32_d10v_vec,
&bfd_elf32_d30v_vec, &bfd_elf32_d30v_vec,
&bfd_elf32_hppa_vec, &bfd_elf32_hppa_vec,
&bfd_elf32_hppa_linux_vec,
&bfd_elf32_i370_vec, &bfd_elf32_i370_vec,
&bfd_elf32_i386_vec, &bfd_elf32_i386_vec,
#ifdef BFD64 #ifdef BFD64

View File

@ -1,5 +1,7 @@
2001-01-14 Alan Modra <alan@linuxcare.com.au> 2001-01-14 Alan Modra <alan@linuxcare.com.au>
* emulparams/hppalinux.sh (OUTPUT_FORMAT): Set to elf32-hppa-linux.
* emultempl/hppaelf.em (hppaelf_after_parse): New function, * emultempl/hppaelf.em (hppaelf_after_parse): New function,
enabling search for libmilli. On a relocatable link, make .text enabling search for libmilli. On a relocatable link, make .text
sections unique. sections unique.

View File

@ -1,6 +1,6 @@
SCRIPT_NAME=elf SCRIPT_NAME=elf
ELFSIZE=32 ELFSIZE=32
OUTPUT_FORMAT="elf32-hppa" OUTPUT_FORMAT="elf32-hppa-linux"
TEXT_START_ADDR=0x1000 TEXT_START_ADDR=0x1000
TARGET_PAGE_SIZE=0x1000 TARGET_PAGE_SIZE=0x1000
MAXPAGESIZE=0x1000 MAXPAGESIZE=0x1000