+2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
+ to return bfd *.
+ (_bfd_elf_link_setup_gnu_properties): Return bfd *.
+ * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
+ the first relocatable ELF input with GNU properties.
+
2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
* elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
elf_property *);
/* Set up GNU properties. */
- void (*setup_gnu_properties) (struct bfd_link_info *);
+ bfd *(*setup_gnu_properties) (struct bfd_link_info *);
/* Encoding used for compact EH tables. */
int (*compact_eh_encoding) (struct bfd_link_info *);
(bfd *, Elf_Internal_Note *);
extern elf_property * _bfd_elf_get_property
(bfd *, unsigned int, unsigned int);
-extern void _bfd_elf_link_setup_gnu_properties
+extern bfd *_bfd_elf_link_setup_gnu_properties
(struct bfd_link_info *);
/* The linker may need to keep track of the number of relocs that it
}
}
-/* Set up GNU properties. */
+/* Set up GNU properties. Return the first relocatable ELF input with
+ GNU properties if found. Otherwise, return NULL. */
-void
+bfd *
_bfd_elf_link_setup_gnu_properties (struct bfd_link_info *info)
{
bfd *abfd, *first_pbfd = NULL;
/* Do nothing if there is no .note.gnu.property section. */
if (!has_properties)
- return;
+ return NULL;
/* Merge .note.gnu.property sections. */
for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link.next)
/* Discard .note.gnu.property section if all properties have
been removed. */
sec->output_section = bfd_abs_section_ptr;
- return;
+ return NULL;
}
/* Compute the section size. */
/* Cache the section contents for elf_link_input_bfd. */
elf_section_data (sec)->this_hdr.contents = contents;
}
+
+ return first_pbfd;
}