diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2010-09-15 17:10:15 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2010-09-15 17:10:15 +0000 |
commit | 492d5973f09a803b6829c5c7d0dde6ea0c77fbfd (patch) | |
tree | 36f94dc549ad7ecf1e157d42d1d733de9251a670 /binutils/binemul.c | |
parent | 349126ea35abd5b62676149a290a2a6c22e6aac3 (diff) | |
download | gdb-492d5973f09a803b6829c5c7d0dde6ea0c77fbfd.zip gdb-492d5973f09a803b6829c5c7d0dde6ea0c77fbfd.tar.gz gdb-492d5973f09a803b6829c5c7d0dde6ea0c77fbfd.tar.bz2 |
Pass "plugin" as target for "ar --plugin" when opening a BFD file.
2010-09-15 H.J. Lu <hongjiu.lu@intel.com>
* ar.c (plugin_target): New.
(main): Set plugin_target to "plugin" for --plugin.
(open_inarch): Initialize target to plugin_target.
(replace_members): Pass plugin_target to ar_emul_replace
and ar_emul_append.
* binemul.h (ar_emul_append): Add a target argument.
(ar_emul_default_append): Likewise.
(ar_emul_replace): Likewise.
(ar_emul_default_replace): Likewise.
(bin_emulation_xfer_struct): Add a target argument to
ar_append and ar_replace.
* binemul.c (ar_emul_append): Updated. Pass target to bfd_openr.
(do_ar_emul_default_append): Likewise.
(ar_emul_default_append): Likewise.
(ar_emul_replace): Likewise.
(ar_emul_default_replace): Likewise.
Diffstat (limited to 'binutils/binemul.c')
-rw-r--r-- | binutils/binemul.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/binutils/binemul.c b/binutils/binemul.c index 2931bda..35587db 100644 --- a/binutils/binemul.c +++ b/binutils/binemul.c @@ -39,19 +39,19 @@ ar_emul_default_usage (FILE *fp) } bfd_boolean -ar_emul_append (bfd **after_bfd, char *file_name, bfd_boolean verbose, - bfd_boolean flatten) +ar_emul_append (bfd **after_bfd, char *file_name, const char *target, + bfd_boolean verbose, bfd_boolean flatten) { if (bin_dummy_emulation.ar_append) - return bin_dummy_emulation.ar_append (after_bfd, file_name, verbose, - flatten); + return bin_dummy_emulation.ar_append (after_bfd, file_name, target, + verbose, flatten); return FALSE; } static bfd_boolean do_ar_emul_default_append (bfd **after_bfd, bfd *new_bfd, - bfd_boolean verbose, bfd_boolean flatten) + bfd_boolean verbose, bfd_boolean flatten) { /* When flattening, add the members of an archive instead of the archive itself. */ @@ -84,32 +84,35 @@ do_ar_emul_default_append (bfd **after_bfd, bfd *new_bfd, bfd_boolean ar_emul_default_append (bfd **after_bfd, char *file_name, - bfd_boolean verbose, bfd_boolean flatten) + const char *target, bfd_boolean verbose, + bfd_boolean flatten) { bfd *new_bfd; - new_bfd = bfd_openr (file_name, NULL); + new_bfd = bfd_openr (file_name, target); AR_EMUL_ELEMENT_CHECK (new_bfd, file_name); return do_ar_emul_default_append (after_bfd, new_bfd, verbose, flatten); } bfd_boolean -ar_emul_replace (bfd **after_bfd, char *file_name, bfd_boolean verbose) +ar_emul_replace (bfd **after_bfd, char *file_name, const char *target, + bfd_boolean verbose) { if (bin_dummy_emulation.ar_replace) - return bin_dummy_emulation.ar_replace (after_bfd, file_name, verbose); + return bin_dummy_emulation.ar_replace (after_bfd, file_name, + target, verbose); return FALSE; } bfd_boolean ar_emul_default_replace (bfd **after_bfd, char *file_name, - bfd_boolean verbose) + const char *target, bfd_boolean verbose) { bfd *temp; temp = *after_bfd; - *after_bfd = bfd_openr (file_name, NULL); + *after_bfd = bfd_openr (file_name, target); AR_EMUL_ELEMENT_CHECK (*after_bfd, file_name); AR_EMUL_REPLACE_PRINT_VERBOSE (verbose, file_name); |