bfd, include, ld, binutils, libctf: CTF should use the dynstr/sym
[binutils-gdb.git] / ld / emultempl / aix.em
index f4441109d23466cd589a47bdc41825c0524061a8..df7471bc4907949bf32b7c2af4471ad6d9e64273 100644 (file)
@@ -9,7 +9,7 @@ fragment <<EOF
 /* This file is is generated by a shell script.  DO NOT EDIT! */
 
 /* AIX emulation code for ${EMULATION_NAME}
-   Copyright (C) 1991-2019 Free Software Foundation, Inc.
+   Copyright (C) 1991-2020 Free Software Foundation, Inc.
    Written by Steve Chamberlain <sac@cygnus.com>
    AIX support by Ian Lance Taylor <ian@cygnus.com>
    AIX 64 bit support by Tom Rix <trix@redhat.com>
@@ -472,8 +472,8 @@ gld${EMULATION_NAME}_handle_option (int optc)
       break;
 
     case OPTION_ERNOTOK:
-      link_info.unresolved_syms_in_objects = RM_GENERATE_ERROR;
-      link_info.unresolved_syms_in_shared_libs = RM_GENERATE_ERROR;
+      link_info.unresolved_syms_in_objects = RM_DIAGNOSE;
+      link_info.unresolved_syms_in_shared_libs = RM_DIAGNOSE;
       break;
 
     case OPTION_EROK:
@@ -1364,6 +1364,7 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
   switch (exp->type.node_class)
     {
     case etree_provide:
+    case etree_provided:
       h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
                                FALSE, FALSE, FALSE);
       if (h == NULL)
@@ -1534,6 +1535,36 @@ gld${EMULATION_NAME}_open_dynamic_archive (const char *arch,
   return TRUE;
 }
 
+static bfd_boolean
+gld${EMULATION_NAME}_print_symbol (struct bfd_link_hash_entry *hash_entry,
+                                  void *ptr)
+{
+  asection *sec = (asection *) ptr;
+
+  if ((hash_entry->type == bfd_link_hash_defined
+       || hash_entry->type == bfd_link_hash_defweak)
+      && sec == hash_entry->u.def.section)
+    {
+      int i;
+      struct xcoff_link_hash_entry *h;
+
+      for (i = 0; i < SECTION_NAME_MAP_LENGTH; i++)
+       print_space ();
+      minfo ("0x%V   ",
+            (hash_entry->u.def.value
+             + hash_entry->u.def.section->output_offset
+             + hash_entry->u.def.section->output_section->vma));
+
+      /* Flag symbol if it has been garbage collected.  */
+      h = (struct xcoff_link_hash_entry *) hash_entry;
+      if ((h != NULL) && !(h->flags & XCOFF_MARK))
+       minfo (" -->gc");
+      minfo ("             %pT\n", hash_entry->root.string);
+    }
+
+  return TRUE;
+}
+
 struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
   gld${EMULATION_NAME}_before_parse,
   syslib_default,
@@ -1541,6 +1572,7 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
   after_parse_default,
   gld${EMULATION_NAME}_after_open,
   after_check_relocs_default,
+  before_place_orphans_default,
   after_allocation_default,
   gld${EMULATION_NAME}_set_output_arch,
   gld${EMULATION_NAME}_choose_target,
@@ -1563,6 +1595,8 @@ struct ld_emulation_xfer_struct ld_${EMULATION_NAME}_emulation = {
   NULL,                                /* new_vers_pattern */
   NULL,                                /* extra_map_file_text */
   ${LDEMUL_EMIT_CTF_EARLY-NULL},
-  ${LDEMUL_EXAMINE_STRTAB_FOR_CTF-NULL}
+  ${LDEMUL_ACQUIRE_STRINGS_FOR_CTF-NULL},
+  ${LDEMUL_NEW_DYNSYM_FOR_CTF-NULL},
+  gld${EMULATION_NAME}_print_symbol
 };
 EOF