public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Binutils <binutils@sourceware.org>
Subject: Re: [PATCH] PR binutils/14625: Enable 64-bit archives in ar and ranlib
Date: Wed, 25 May 2016 00:33:00 -0000	[thread overview]
Message-ID: <20160525003323.GG3300@bubble.grove.modra.org> (raw)
In-Reply-To: <CAMe9rOrnkc27NGzQE_AbUfVk=QS+LNYb2j1iK7FrBsQ1YyiVtg@mail.gmail.com>

On Tue, May 24, 2016 at 01:29:07PM -0700, H.J. Lu wrote:
> 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.

OK, but

> +      /* The archive file format only has 4 bytes to store the offset
> +	 of the member.  Generate 64-bit archive if an archive past its
> +	 4Gb limit.  */

Generate a 64-bit archive if an archive is past...

> +	  /* Generate 64-bit archive if an archive past its 4Gb limit.  */

Same.

> +# 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.

Comment is now wrong, since you auto-detect whether a 64-bit archive
format is needed.

> --- a/binutils/NEWS
> +++ b/binutils/NEWS
> @@ -1,5 +1,8 @@
>  -*- text -*-
>  
> +* Add a configure option, --enable-64-bit-archive, to enable 64-bit
> +  archives in ar and ranlib.
> +

* Add a configure option, --enable-64-bit-archive, to force use of a
  64-bit format when creating an archive symbol index.

-- 
Alan Modra
Australia Development Lab, IBM

  reply	other threads:[~2016-05-25  0:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-20 12:10 H.J. Lu
2016-05-23  9:42 ` Alan Modra
2016-05-24 17:03   ` H.J. Lu
2016-05-24 20:29     ` H.J. Lu
2016-05-25  0:33       ` Alan Modra [this message]
2016-05-25 16:49         ` H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160525003323.GG3300@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).