Pass link_info to _bfd_merge_private_bfd_data
[deliverable/binutils-gdb.git] / bfd / elf32-i370.c
index 57af406439147a44baf3f41666db7db898cdd075..3130f96af95e4bf49c7b73584cc00c29b35e0f7f 100644 (file)
@@ -303,8 +303,8 @@ i370_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
   r_type = ELF32_R_TYPE (dst->r_info);
   if (r_type >= R_I370_max)
     {
-      (*_bfd_error_handler) (_("%B: unrecognised I370 reloc number: %d"),
-                            abfd, r_type);
+      _bfd_error_handler (_("%B: unrecognised I370 reloc number: %d"),
+                         abfd, r_type);
       bfd_set_error (bfd_error_bad_value);
       r_type = R_I370_NONE;
     }
@@ -330,8 +330,9 @@ i370_elf_set_private_flags (bfd *abfd, flagword flags)
    object file when linking.  */
 
 static bfd_boolean
-i370_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
+i370_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
 {
+  bfd *obfd = info->output_bfd;
   flagword old_flags;
   flagword new_flags;
 
@@ -352,7 +353,7 @@ i370_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd)
 
   else                                 /* Incompatible flags.  */
     {
-      (*_bfd_error_handler)
+      _bfd_error_handler
        ("%B: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
         ibfd, (long) new_flags, (long) old_flags);
 
@@ -919,13 +920,13 @@ i370_elf_finish_dynamic_sections (bfd *output_bfd,
            {
              asection *s;
 
-             s = bfd_get_section_by_name (output_bfd, name);
+             s = bfd_get_linker_section (dynobj, name);
              if (s == NULL)
                dyn.d_un.d_val = 0;
              else
                {
                  if (! size)
-                   dyn.d_un.d_ptr = s->vma;
+                   dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
                  else
                    dyn.d_un.d_val = s->size;
                }
@@ -1074,9 +1075,8 @@ i370_elf_relocate_section (bfd *output_bfd,
       if ((unsigned) r_type >= (unsigned) R_I370_max
          || !i370_elf_howto_table[(int)r_type])
        {
-         (*_bfd_error_handler) ("%B: unknown relocation type %d",
-                                input_bfd,
-                                (int) r_type);
+         _bfd_error_handler ("%B: unknown relocation type %d",
+                             input_bfd, (int) r_type);
 
          bfd_set_error (bfd_error_bad_value);
          ret = FALSE;
@@ -1137,15 +1137,13 @@ i370_elf_relocate_section (bfd *output_bfd,
            ;
          else if (!bfd_link_relocatable (info))
            {
-             if ((*info->callbacks->undefined_symbol)
-                 (info, h->root.root.string, input_bfd,
-                  input_section, rel->r_offset,
-                  (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
-                   || ELF_ST_VISIBILITY (h->other))))
-               {
-                 ret = FALSE;
-                 continue;
-               }
+             (*info->callbacks->undefined_symbol)
+               (info, h->root.root.string, input_bfd,
+                input_section, rel->r_offset,
+                (info->unresolved_syms_in_objects == RM_GENERATE_ERROR
+                 || ELF_ST_VISIBILITY (h->other)));
+             ret = FALSE;
+             continue;
            }
        }
 
@@ -1159,7 +1157,7 @@ i370_elf_relocate_section (bfd *output_bfd,
       switch ((int) r_type)
        {
        default:
-         (*_bfd_error_handler)
+         _bfd_error_handler
            ("%B: unknown relocation type %d for symbol %s",
             input_bfd, (int) r_type, sym_name);
 
@@ -1300,7 +1298,7 @@ i370_elf_relocate_section (bfd *output_bfd,
 
        case (int) R_I370_COPY:
        case (int) R_I370_RELATIVE:
-         (*_bfd_error_handler)
+         _bfd_error_handler
            ("%B: Relocation %s is not yet supported for symbol %s.",
             input_bfd,
             i370_elf_howto_table[(int) r_type]->name,
This page took 0.025335 seconds and 4 git commands to generate.