bfd_set_section_size (reloc_s, 0);
- /* FIXME: I am not sure if this is the right way to solve PR 29998.
- It might be better to change ldlang.c:lang_statement_append() so that it
- checks to see if *(list->tail) is non-NULL and if so, set element->next
- to its contents.
-
- The issue is that this function is called after lang_process().
- lang_process () will have gone through any input archives, and if the
- last input file is an archive then it will have left file_chain.tail
- pointing to the last used element of that archive. Calling
- ldlang_add_file() here then blows aaway the link to that archive element,
- effectively deleting it from the input. In order to prevent this, the
- assignment below fills in the next field of the statement that is about
- to appended to the file chain. */
- if (file_chain.tail != NULL)
- filler_file->next = & (* file_chain.tail)->input_statement;
-
ldlang_add_file (filler_file);
}
if (h->symbol_class != C_NT_WEAK || h->numaux != 1)
continue;
h2 = h->auxbfd->tdata.coff_obj_data->sym_hashes
- [h->aux->x_sym.x_tagndx.l];
+ [h->aux->x_sym.x_tagndx.u32];
/* We don't want a base reloc if the aux sym is not
found, undefined, or if it is the constant ABS
zero default value. (We broaden that slightly by
tmp_seq++;
abfd = bfd_create (oname, parent);
+ free (oname);
bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
tmp_seq++;
abfd = bfd_create (oname, parent);
+ free (oname);
bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
bfd *abfd;
const unsigned char *jmp_bytes = NULL;
int jmp_byte_count = 0;
+ const char *internal_name = exp->internal_name;
+
+ if (!exp->flag_noname)
+ {
+ /* Check for a decorated symbol name */
+ struct decoration_hash_entry *entry;
+
+ entry = (struct decoration_hash_entry *)
+ bfd_hash_lookup (&(coff_hash_table (&link_info)->decoration_hash),
+ internal_name, false, false);
+ if (entry)
+ {
+ if (entry->decorated_link)
+ {
+ internal_name = entry->decorated_link->root.string;
+
+ if (pe_details->underscored && internal_name[0] == '_')
+ internal_name++;
+ }
+ else
+ {
+ einfo (_("%P: error: NULL decorated name for %s\n"), internal_name);
+ }
+ }
+ }
/* Include the jump stub section only if it is needed. A jump
stub is needed if the symbol being imported <sym> is a function
tmp_seq++;
abfd = bfd_create (oname, parent);
+ free (oname);
bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
id4 = quick_section (abfd, ".idata$4", SEC_HAS_CONTENTS, 2);
id6 = quick_section (abfd, ".idata$6", SEC_HAS_CONTENTS, 2);
- if (*exp->internal_name == '@')
+ if (*internal_name == '@')
{
quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC,
BSF_GLOBAL, 0);
if (include_jmp_stub)
- quick_symbol (abfd, "", exp->internal_name, "", tx, BSF_GLOBAL, 0);
- quick_symbol (abfd, "__imp_", exp->internal_name, "", id5,
+ quick_symbol (abfd, "", internal_name, "", tx, BSF_GLOBAL, 0);
+ quick_symbol (abfd, "__imp_", internal_name, "", id5,
BSF_GLOBAL, 0);
/* Fastcall applies only to functions,
so no need for auto-import symbol. */
quick_symbol (abfd, U ("_head_"), dll_symname, "", UNDSEC,
BSF_GLOBAL, 0);
if (include_jmp_stub)
- quick_symbol (abfd, U (""), exp->internal_name, "", tx,
+ quick_symbol (abfd, U (""), internal_name, "", tx,
BSF_GLOBAL, 0);
- quick_symbol (abfd, "__imp_", U (""), exp->internal_name, id5,
+ quick_symbol (abfd, "__imp_", U (""), internal_name, id5,
BSF_GLOBAL, 0);
/* Symbol to reference ord/name of imported
data symbol, used to implement auto-import. */
if (exp->flag_data)
- quick_symbol (abfd, "__nm_", U (""), exp->internal_name, id6,
+ quick_symbol (abfd, "__nm_", U (""), internal_name, id6,
BSF_GLOBAL,0);
}
if (pe_dll_compat_implib)
- quick_symbol (abfd, "___imp_", exp->internal_name, "", id5,
+ quick_symbol (abfd, "___imp_", internal_name, "", id5,
BSF_GLOBAL, 0);
if (include_jmp_stub)
tmp_seq++;
abfd = bfd_create (oname, parent);
+ free (oname);
bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
tmp_seq++;
abfd = bfd_create (oname, parent);
+ free (oname);
bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
tmp_seq++;
abfd = bfd_create (oname, parent);
+ free (oname);
bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
rt_rel
= quick_section (abfd, ".rdata_runtime_pseudo_reloc", SEC_HAS_CONTENTS, 2);
+ bfd_coff_set_long_section_names (abfd, true);
quick_symbol (abfd, "", fixup_name, "", UNDSEC, BSF_GLOBAL, 0);
tmp_seq++;
abfd = bfd_create (oname, parent);
+ free (oname);
bfd_find_target (pe_details->object_target, abfd);
bfd_make_writable (abfd);
}
else if (addend != 0)
- einfo (_("%X%P: %C: variable '%pT' can't be auto-imported; please read the documentation for ld's --enable-auto-import for details\n"),
+ einfo (_("%X%P: %H: variable '%pT' can't be auto-imported; please read the documentation for ld's --enable-auto-import for details\n"),
s->owner, s, rel->address, (*rel->sym_ptr_ptr)->name);
}
pe_output_file_set_long_section_names (abfd);
process_def_file_and_drectve (abfd, info);
- if (pe_def_file->num_exports == 0 && !bfd_link_pic (info))
+ if (pe_def_file->num_exports == 0
+ && (!bfd_link_pic (info) || pe_dll_exclude_all_symbols))
{
if (pe_dll_enable_reloc_section)
{