mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 17:18:55 +00:00
Display the reference causing a shared library to be needed
Adds a section for --as-needed libraries to a linker map file, similar to what we do for archive libraries. bfd/ * elflink.c (elf_link_add_object_symbols): Call minfo for --as-needed. ld/ * ldlang.c (asneeded_list_head, asneeded_list_tail): New vars. (lang_init): Initialise them. (lang_print_asneeded): New function. (lang_process): Call lang_print_asneeded. * ldlang.h (struct asneeded_minfo): New. (asneeded_list_tail): Declare. * ldmain.c (add_archive_element): Improve archive map heading. * ldmisc.c (minfo): Stash --as-needed info.
This commit is contained in:
17
ld/ldmisc.c
17
ld/ldmisc.c
@@ -484,7 +484,22 @@ minfo (const char *fmt, ...)
|
||||
va_list arg;
|
||||
|
||||
va_start (arg, fmt);
|
||||
vfinfo (config.map_file, fmt, arg, FALSE);
|
||||
if (fmt[0] == '%' && fmt[1] == '!' && fmt[2] == 0)
|
||||
{
|
||||
/* Stash info about --as-needed shared libraries. Print
|
||||
later so they don't appear intermingled with archive
|
||||
library info. */
|
||||
struct asneeded_minfo *m = xmalloc (sizeof *m);
|
||||
|
||||
m->next = NULL;
|
||||
m->soname = va_arg (arg, const char *);
|
||||
m->ref = va_arg (arg, bfd *);
|
||||
m->name = va_arg (arg, const char *);
|
||||
*asneeded_list_tail = m;
|
||||
asneeded_list_tail = &m->next;
|
||||
}
|
||||
else
|
||||
vfinfo (config.map_file, fmt, arg, FALSE);
|
||||
va_end (arg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user