diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2016-05-25 09:46:47 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2016-05-25 09:47:03 -0700 |
commit | e6cc316af931911da20249e19f9342e5cf8aeeff (patch) | |
tree | d43346d03bc137d6b7c22e87f39308b4cba4fd6b /bfd/configure | |
parent | b95a0a3177bcf797c8f5ad6a7d276fb6275352b7 (diff) | |
download | gdb-e6cc316af931911da20249e19f9342e5cf8aeeff.zip gdb-e6cc316af931911da20249e19f9342e5cf8aeeff.tar.gz gdb-e6cc316af931911da20249e19f9342e5cf8aeeff.tar.bz2 |
Enable 64-bit archives in ar and ranlib
Since existing ld and gold support the 64-bit (MIPS) ELF archives, we
can use the 64-bit (MIPS) ELF archives as 64-bit archives. Since the
plugin target is used to create archive in plugin-enabled ar, we need
a way to enable 64-bit archives in the plugin target. This patch adds
--enable-64-bit-archive to bfd to force 64-bit archives in ar and
ranlib. Since both 64-bit MIPS and s390 ELF targets currently use
64-bit archives, 64-bit archives are enabled by default for them.
64-bit archive is generated automatically if the archive is too big.
Tested on Linux/x86 and Linux/x86-64 with existing ld and gold.
bfd/
PR binutils/14625
* archive.c (bfd_slurp_armap): Replace
bfd_elf64_archive_slurp_armap with
_bfd_archive_64_bit_slurp_armap.
(bsd_write_armap): Call _bfd_archive_64_bit_write_armap if
BFD64 is defined and the archive is too big.
(coff_write_armap): Likewise.
* archive64.c (bfd_elf64_archive_slurp_armap): Renamed to ...
(_bfd_archive_64_bit_slurp_armap): This.
(bfd_elf64_archive_write_armap): Renamed to ...
(_bfd_archive_64_bit_write_armap): This.
* configure.ac: Add --enable-64-bit-archive.
(want_64_bit_archive): New. Set to true by default for 64-bit
MIPS and s390 ELF targets.
(USE_64_BIT_ARCHIVE): New AC_DEFINE.
* config.in: Regenerated.
* configure: Likewise.
* elf64-mips.c (bfd_elf64_archive_functions): Removed.
(bfd_elf64_archive_slurp_armap): Likewise.
(bfd_elf64_archive_write_armap): Likewise.
(bfd_elf64_archive_slurp_extended_name_table): Likewise.
(bfd_elf64_archive_construct_extended_name_table): Likewise.
(bfd_elf64_archive_truncate_arname): Likewise.
(bfd_elf64_archive_read_ar_hdr): Likewise.
(bfd_elf64_archive_write_ar_hdr): Likewise.
(bfd_elf64_archive_openr_next_archived_file): Likewise.
(bfd_elf64_archive_get_elt_at_index): Likewise.
(bfd_elf64_archive_generic_stat_arch_elt): Likewise.
(bfd_elf64_archive_update_armap_timestamp): Likewise.
* elf64-s390.c (bfd_elf64_archive_functions): Removed.
(bfd_elf64_archive_slurp_armap): Likewise.
(bfd_elf64_archive_write_armap): Likewise.
(bfd_elf64_archive_slurp_extended_name_table): Likewise.
(bfd_elf64_archive_construct_extended_name_table): Likewise.
(bfd_elf64_archive_truncate_arname): Likewise.
(bfd_elf64_archive_read_ar_hdr): Likewise.
(bfd_elf64_archive_write_ar_hdr): Likewise.
(bfd_elf64_archive_openr_next_archived_file): Likewise.
(bfd_elf64_archive_get_elt_at_index): Likewise.
(bfd_elf64_archive_generic_stat_arch_elt): Likewise.
(bfd_elf64_archive_update_armap_timestamp): Likewise.
* elfxx-target.h (TARGET_BIG_SYM): Use _bfd_archive_64_bit on
BFD_JUMP_TABLE_ARCHIVE if USE_64_BIT_ARCHIVE is defined and
bfd_elfNN_archive_functions isn't defined.
(TARGET_LITTLE_SYM): Likewise.
* libbfd-in.h (_bfd_archive_64_bit_slurp_armap): New prototype.
(_bfd_archive_64_bit_write_armap): Likewise.
(_bfd_archive_64_bit_slurp_extended_name_table): New macro.
(_bfd_archive_64_bit_construct_extended_name_table): Likewise.
(_bfd_archive_64_bit_truncate_arname): Likewise.
(_bfd_archive_64_bit_read_ar_hdr): Likewise.
(_bfd_archive_64_bit_write_ar_hdr): Likewise.
(_bfd_archive_64_bit_openr_next_archived_file): Likewise.
(_bfd_archive_64_bit_get_elt_at_index): Likewise.
(_bfd_archive_64_bit_generic_stat_arch_elt): Likewise.
(_bfd_archive_64_bit_update_armap_timestamp): Likewise.
* libbfd.h: Regenerated.
* plugin.c (plugin_vec): Use _bfd_archive_64_bit on
BFD_JUMP_TABLE_ARCHIVE if USE_64_BIT_ARCHIVE is defined.
binutils/
PR binutils/14625
* NEWS: Mention --enable-64-bit-archive.
Diffstat (limited to 'bfd/configure')
-rwxr-xr-x | bfd/configure | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/bfd/configure b/bfd/configure index f8617b9..fab203d 100755 --- a/bfd/configure +++ b/bfd/configure @@ -789,6 +789,7 @@ enable_plugins enable_largefile enable_64_bit_bfd enable_targets +enable_64_bit_archive with_mmap enable_secureplt enable_leading_mingw64_underscores @@ -1442,6 +1443,7 @@ Optional Features: --disable-largefile omit support for large files --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes) --enable-targets alternative target configurations + --enable-64-bit-archive force 64-bit archives --enable-secureplt Default to creating read-only plt entries --enable-leading-mingw64-underscores Enable leading underscores on 64 bit mingw targets @@ -11425,7 +11427,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11428 "configure" +#line 11430 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11531,7 +11533,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11534 "configure" +#line 11536 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12129,6 +12131,17 @@ if test "${enable_targets+set}" = set; then : esac fi +# Check whether --enable-64_bit_archive was given. +if test "${enable_64_bit_archive+set}" = set; then : + enableval=$enable_64_bit_archive; case "${enableval}" in + yes) want_64_bit_archive=true ;; + no) want_64_bit_archive=false ;; + *) as_fn_error "bad value ${enableval} for 64-bit-archive option" "$LINENO" 5 ;; +esac +else + want_64_bit_archive=unset +fi + # Check whether --with-mmap was given. if test "${with_mmap+set}" = set; then : @@ -14596,6 +14609,23 @@ else # all_targets is true selarchs=`echo $selarchs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` fi # all_targets is true +if test "x$want_64_bit_archive" = xunset; then + # 64-bit MIPS and s390 ELF targets use 64-bit archives. + case "${bfd_backends}" in + *elf64-mips* | *elf64-s390*) + want_64_bit_archive=true + ;; + esac +fi + +# 64-bit archives need a 64-bit bfd_vma. +if test "x$want_64_bit_archive" = xtrue; then + want64=true + +$as_echo "#define USE_64_BIT_ARCHIVE 1" >>confdefs.h + +fi + case ${host64}-${target64}-${want64} in *true*) wordsize=64 |