/* Plugin control for the GNU linker.
- Copyright (C) 2010-2021 Free Software Foundation, Inc.
+ Copyright (C) 2010-2022 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
pointer. */
typedef struct plugin_input_file
{
+ /* The dummy BFD. */
bfd *abfd;
+ /* The original input BFD. Non-NULL if it is an archive member. */
bfd *ibfd;
view_buffer_t view_buffer;
char *name;
/* We need to know if the sym is referenced from non-IR files. Or
even potentially-referenced, perhaps in a future final link if
this is a partial one, perhaps dynamically at load-time if the
- symbol is externally visible. Also check for wrapper symbol. */
- if (blhe->non_ir_ref_regular || wrap_status == wrapper)
+ symbol is externally visible. Also check for __real_SYM
+ reference and wrapper symbol. */
+ if (blhe->non_ir_ref_regular
+ || blhe->ref_real
+ || wrap_status == wrapper)
res = LDPR_PREVAILING_DEF;
else if (wrap_status == wrapped)
res = LDPR_RESOLVED_IR;
file.handle = input;
input->abfd = abfd;
- input->ibfd = ibfd;
+ input->ibfd = ibfd->my_archive != NULL ? ibfd : NULL;
input->view_buffer.addr = NULL;
input->view_buffer.filesize = 0;
input->view_buffer.offset = 0;