diff options
author | Ian Lance Taylor <ian@airs.com> | 1995-07-04 20:22:43 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1995-07-04 20:22:43 +0000 |
commit | 27b1ec94784b837c366ebd3a2cfa754f07620368 (patch) | |
tree | fb5ef1adb401f42c01dc911b00f471cecefb5295 /bfd/archive.c | |
parent | 4a674fd49b8839dafe6198a72c2bb2efaafa9bf2 (diff) | |
download | gdb-27b1ec94784b837c366ebd3a2cfa754f07620368.zip gdb-27b1ec94784b837c366ebd3a2cfa754f07620368.tar.gz gdb-27b1ec94784b837c366ebd3a2cfa754f07620368.tar.bz2 |
* 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.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r-- | bfd/archive.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/bfd/archive.c b/bfd/archive.c index 53de8fc..44cad84 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -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; |