* archive.c (_bfd_construct_extended_name_table): If

BFD_TRADITIONAL_FORMAT is set, limit the length of all file names
	to ar_max_namelen.
	(bfd_dont_truncate_arname): If BFD_TRADITIONAL_FORMAT is set, call
	bfd_bsd_truncate_arname.
PR 6888.
This commit is contained in:
Ian Lance Taylor 1995-07-04 20:22:43 +00:00
parent 4a674fd49b
commit 27b1ec9478
2 changed files with 17 additions and 9 deletions

View File

@ -1,6 +1,11 @@
Tue Jul 4 12:22:21 1995 Ian Lance Taylor <ian@cygnus.com>
* archive.c (_bfd_write_archive_contents): Revert June 1 change.
* archive.c (_bfd_construct_extended_name_table): If
BFD_TRADITIONAL_FORMAT is set, limit the length of all file names
to ar_max_namelen.
(bfd_dont_truncate_arname): If BFD_TRADITIONAL_FORMAT is set, call
bfd_bsd_truncate_arname.
(_bfd_write_archive_contents): Revert June 1 change.
* elfcode.h (NAME(bfd_elf,record_link_assignment)): Add provide
argument.

View File

@ -1240,6 +1240,11 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen)
return false;
thislen = strlen (normal);
if (thislen > maxname
&& (bfd_get_file_flags (abfd) & BFD_TRADITIONAL_FORMAT) != 0)
thislen = maxname;
if (thislen > maxname)
{
/* Add one to leave room for \n. */
@ -1449,6 +1454,12 @@ bfd_dont_truncate_arname (abfd, pathname, arhdr)
const char *filename;
int maxlen = ar_maxnamelen (abfd);
if ((bfd_get_file_flags (abfd) & BFD_TRADITIONAL_FORMAT) != 0)
{
bfd_bsd_truncate_arname (abfd, pathname, arhdr);
return;
}
filename = normalize (abfd, pathname);
if (filename == NULL)
{
@ -1592,14 +1603,6 @@ _bfd_write_archive_contents (arch)
}
}
/* @@ This leads to archives that are incompatible with the native
AR on many systems, such as HP/UX and SunOS. [Cygnus PR
binutils/6888] It's a nice extension, but unless it can be made
optional, we shouldn't use it. This is a lame fix, but I don't
have time to fix it right just now. KR 1995/06/01 */
/* Turning it off is a disaster for the many people who rely upon
it. We should make it optional, but since that is evidently not
happening soon it needs to be used by default. ILT 1995/07/04. */
if (!BFD_SEND (arch, _bfd_construct_extended_name_table,
(arch, &etable, &elength, &ename)))
return false;