mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
* lexsup.c (parse_args): Handle --wrap.
* ldmain.c (main): Initialize link_info.wrap_hash. * ldexp.c (fold_name): Use bfd_wrapped_link_hash_lookup in DEFINED and NAME cases. * ld.texinfo, ld.1: Document --wrap.
This commit is contained in:
18
ld/lexsup.c
18
ld/lexsup.c
@@ -108,7 +108,7 @@ parse_args (argc, argv)
|
||||
#define OPTION_SPLIT_BY_RELOC (OPTION_WARN_ONCE + 1)
|
||||
#define OPTION_SPLIT_BY_FILE (OPTION_SPLIT_BY_RELOC + 1)
|
||||
#define OPTION_WHOLE_ARCHIVE (OPTION_SPLIT_BY_FILE + 1)
|
||||
|
||||
#define OPTION_WRAP (OPTION_WHOLE_ARCHIVE + 1)
|
||||
|
||||
static struct option longopts[] = {
|
||||
/* Sorted alphabeticaly, except for the PE options grouped at the end. */
|
||||
@@ -165,8 +165,8 @@ parse_args (argc, argv)
|
||||
{"split-by-reloc", required_argument, NULL, OPTION_SPLIT_BY_RELOC},
|
||||
{"split-by-file", no_argument, NULL, OPTION_SPLIT_BY_FILE},
|
||||
{"whole-archive", no_argument, NULL, OPTION_WHOLE_ARCHIVE},
|
||||
{"wrap", required_argument, NULL, OPTION_WRAP},
|
||||
|
||||
|
||||
{NULL, no_argument, NULL, 0}
|
||||
};
|
||||
|
||||
@@ -498,6 +498,20 @@ parse_args (argc, argv)
|
||||
case OPTION_WHOLE_ARCHIVE:
|
||||
whole_archive = true;
|
||||
break;
|
||||
case OPTION_WRAP:
|
||||
if (link_info.wrap_hash == NULL)
|
||||
{
|
||||
link_info.wrap_hash = ((struct bfd_hash_table *)
|
||||
xmalloc (sizeof (struct bfd_hash_table)));
|
||||
if (! bfd_hash_table_init_n (link_info.wrap_hash,
|
||||
bfd_hash_newfunc,
|
||||
61))
|
||||
einfo ("%P%F: bfd_hash_table_init failed: %E\n");
|
||||
}
|
||||
if (bfd_hash_lookup (link_info.wrap_hash, optarg, true, true)
|
||||
== NULL)
|
||||
einfo ("%P%F: bfd_hash_lookup failed: %E\n");
|
||||
break;
|
||||
case 'X':
|
||||
link_info.discard = discard_l;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user