aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog12
-rw-r--r--bfd/archive.c13
-rw-r--r--bfd/bfd-in2.h5
-rw-r--r--bfd/bfd.c5
4 files changed, 29 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 429e423..f71c9aa 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,15 @@
+2019-10-21 Alan Modra <amodra@gmail.com>
+
+ PR 452
+ * archive.c (normalize): Return file unchanged when
+ BFD_ARCHIVE_FULL_PATH.
+ (_bfd_construct_extended_name_table): Pass abfd, the output
+ bfd, to normalize.
+ (_bfd_archive_bsd44_construct_extended_name_table): Likewise.
+ * bfd.c (struct bfd): Make flags a full flagword.
+ (BFD_ARCHIVE_FULL_PATH): Define.
+ * bfd-in2.h: Regenerate.
+
2019-10-20 John David Anglin <danglin@gcc.gnu.org>
* elf32-hppa.c (elf32_hppa_size_dynamic_sections): Provide 8-byte
diff --git a/bfd/archive.c b/bfd/archive.c
index ccc09ad..6b7a78c 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -1299,6 +1299,9 @@ normalize (bfd *abfd, const char *file)
const char *last;
char *copy;
+ if (abfd->flags & BFD_ARCHIVE_FULL_PATH)
+ return file;
+
first = file + strlen (file) - 1;
last = first + 1;
@@ -1326,8 +1329,10 @@ normalize (bfd *abfd, const char *file)
#else
static const char *
-normalize (bfd *abfd ATTRIBUTE_UNUSED, const char *file)
+normalize (bfd *abfd, const char *file)
{
+ if (abfd->flags & BFD_ARCHIVE_FULL_PATH)
+ return file;
return lbasename (file);
}
#endif
@@ -1562,7 +1567,7 @@ _bfd_construct_extended_name_table (bfd *abfd,
continue;
}
- normal = normalize (current, current->filename);
+ normal = normalize (abfd, current->filename);
if (normal == NULL)
return FALSE;
@@ -1643,7 +1648,7 @@ _bfd_construct_extended_name_table (bfd *abfd,
}
else
{
- normal = normalize (current, filename);
+ normal = normalize (abfd, filename);
if (normal == NULL)
return FALSE;
}
@@ -1714,7 +1719,7 @@ _bfd_archive_bsd44_construct_extended_name_table (bfd *abfd,
current != NULL;
current = current->archive_next)
{
- const char *normal = normalize (current, current->filename);
+ const char *normal = normalize (abfd, current->filename);
int has_space = 0;
unsigned int len;
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 1c468dc..30b195a 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -6498,7 +6498,7 @@ struct bfd
ENUM_BITFIELD (bfd_direction) direction : 2;
/* Format_specific flags. */
- flagword flags : 20;
+ flagword flags;
/* Values that may appear in the flags field of a BFD. These also
appear in the object_flags field of the bfd_target structure, where
@@ -6585,6 +6585,9 @@ struct bfd
/* Use the ELF STT_COMMON type in this BFD. */
#define BFD_USE_ELF_STT_COMMON 0x80000
+ /* Put pathnames into archives (non-POSIX). */
+#define BFD_ARCHIVE_FULL_PATH 0x100000
+
/* Flags bits to be saved in bfd_preserve_save. */
#define BFD_FLAGS_SAVED \
(BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \
diff --git a/bfd/bfd.c b/bfd/bfd.c
index b3078ea..94e9f27 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -92,7 +92,7 @@ CODE_FRAGMENT
. ENUM_BITFIELD (bfd_direction) direction : 2;
.
. {* Format_specific flags. *}
-. flagword flags : 20;
+. flagword flags;
.
. {* Values that may appear in the flags field of a BFD. These also
. appear in the object_flags field of the bfd_target structure, where
@@ -179,6 +179,9 @@ CODE_FRAGMENT
. {* Use the ELF STT_COMMON type in this BFD. *}
.#define BFD_USE_ELF_STT_COMMON 0x80000
.
+. {* Put pathnames into archives (non-POSIX). *}
+.#define BFD_ARCHIVE_FULL_PATH 0x100000
+.
. {* Flags bits to be saved in bfd_preserve_save. *}
.#define BFD_FLAGS_SAVED \
. (BFD_IN_MEMORY | BFD_COMPRESS | BFD_DECOMPRESS | BFD_LINKER_CREATED \