aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-04-01 19:53:53 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2009-04-01 19:53:53 +0000
commit24c611d1c4f188680de12c0cf1993d266b7e630a (patch)
treefbe310903a939fa4cf626ec29f0eeda440149f86 /ld
parentd286971a6bf52ec49862a488ada6c0566263ad7b (diff)
downloadgdb-24c611d1c4f188680de12c0cf1993d266b7e630a.zip
gdb-24c611d1c4f188680de12c0cf1993d266b7e630a.tar.gz
gdb-24c611d1c4f188680de12c0cf1993d266b7e630a.tar.bz2
bfd/
* bfd-in.h (bfd_xcoff_split_import_path): Declare. (bfd_xcoff_set_archive_import_path): Likewise. * bfd-in2.h: Regenerate. * xcofflink.c: Include libiberty.h. (xcoff_archive_info): New structure. (xcoff_archive_info_hash): New function. (xcoff_archive_info_eq): Likewise. (xcoff_get_archive_info): Likewise. (_bfd_xcoff_bfd_link_hash_table_create): Initialize archive_info. (bfd_xcoff_split_import_path): New function. (bfd_xcoff_set_archive_import_path): Likewise. (xcoff_set_import_path): Move earlier in file. (xcoff_link_add_dynamic_symbols): Set the import path of a non-archive object to the the directory part of the bfd's filename. Get the import path and filename of an archive object from the archive's xcoff_tdata, initializing it if necessary. Update use of import_file_id. (bfd_link_input_bfd): Update use of import_file_id. (xcoff_write_global_symbol): Likewise. ld/ * emultempl/aix.em (gld${EMULATION_NAME}_open_dynamic_archive): New function. (ld_${EMULATION_NAME}_emulation): Use it.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/emultempl/aix.em53
2 files changed, 38 insertions, 21 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 2eefd16..378e855 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-01 Richard Sandiford <r.sandiford@uk.ibm.com>
+
+ * emultempl/aix.em (gld${EMULATION_NAME}_open_dynamic_archive): New
+ function.
+ (ld_${EMULATION_NAME}_emulation): Use it.
+
2009-03-20 H.J. Lu <hongjiu.lu@intel.com>
PR ld/9970
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index 8558660..b43ffbb 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -1096,32 +1096,18 @@ gld${EMULATION_NAME}_read_file (const char *filename, bfd_boolean import)
else
{
char cs;
- char *file;
+ char *start;
(void) obstack_finish (o);
keep = TRUE;
- imppath = s;
- file = NULL;
+ start = s;
while (!ISSPACE (*s) && *s != '(' && *s != '\0')
- {
- if (*s == '/')
- file = s + 1;
- ++s;
- }
- if (file != NULL)
- {
- file[-1] = '\0';
- impfile = file;
- if (imppath == file - 1)
- imppath = "/";
- }
- else
- {
- impfile = imppath;
- imppath = "";
- }
+ ++s;
cs = *s;
*s = '\0';
+ if (!bfd_xcoff_split_import_path (link_info.output_bfd,
+ start, &imppath, &impfile))
+ einfo ("%F%P: Could not parse import path: %E\n");
while (ISSPACE (cs))
{
++s;
@@ -1433,6 +1419,31 @@ gld${EMULATION_NAME}_set_output_arch (void)
ldfile_output_machine_name = bfd_printable_name (link_info.output_bfd);
}
+static bfd_boolean
+gld${EMULATION_NAME}_open_dynamic_archive (const char *arch,
+ search_dirs_type *search,
+ lang_input_statement_type *entry)
+{
+ const char *filename;
+ char *path;
+
+ if (!entry->is_archive)
+ return FALSE;
+
+ filename = entry->filename;
+ path = concat (search->name, "/lib", entry->filename, arch, ".a", NULL);
+ if (!ldfile_try_open_bfd (path, entry))
+ {
+ free (path);
+ return FALSE;
+ }
+ /* Don't include the searched directory in the import path. */
+ bfd_xcoff_set_archive_import_path (&link_info, entry->the_bfd,
+ path + strlen (search->name) + 1);
+ entry->filename = path;
+ return TRUE;
+}
+
struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
gld${EMULATION_NAME}_before_parse,
syslib_default,
@@ -1448,7 +1459,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
"${OUTPUT_FORMAT}",
finish_default,
gld${EMULATION_NAME}_create_output_section_statements,
- 0, /* open_dynamic_archive */
+ gld${EMULATION_NAME}_open_dynamic_archive,
0, /* place_orphan */
0, /* set_symbols */
gld${EMULATION_NAME}_parse_args,