aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf-properties.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-04-27 09:07:23 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-04-27 09:07:34 -0700
commitfba37edd96c8dc65a63bd5b4fef5366de45b165a (patch)
tree5aef42af5b2094e09ed33f93cf33c90a3c160489 /bfd/elf-properties.c
parent1f78f649e868979d36490d7c2ea0b3d41abc5ec6 (diff)
downloadgdb-fba37edd96c8dc65a63bd5b4fef5366de45b165a.zip
gdb-fba37edd96c8dc65a63bd5b4fef5366de45b165a.tar.gz
gdb-fba37edd96c8dc65a63bd5b4fef5366de45b165a.tar.bz2
Change _bfd_elf_link_setup_gnu_properties to bfd *
Change setup_gnu_properties to return the first relocatable ELF input with GNU properties so that a backend can make decision based on GNU properties. * 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.
Diffstat (limited to 'bfd/elf-properties.c')
-rw-r--r--bfd/elf-properties.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/bfd/elf-properties.c b/bfd/elf-properties.c
index 048ea9c..fda8875 100644
--- a/bfd/elf-properties.c
+++ b/bfd/elf-properties.c
@@ -299,9 +299,10 @@ elf_merge_gnu_property_list (bfd *abfd, elf_property_list **listp)
}
}
-/* 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;
@@ -336,7 +337,7 @@ _bfd_elf_link_setup_gnu_properties (struct bfd_link_info *info)
/* 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)
@@ -411,7 +412,7 @@ _bfd_elf_link_setup_gnu_properties (struct bfd_link_info *info)
/* 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. */
@@ -488,4 +489,6 @@ _bfd_elf_link_setup_gnu_properties (struct bfd_link_info *info)
/* Cache the section contents for elf_link_input_bfd. */
elf_section_data (sec)->this_hdr.contents = contents;
}
+
+ return first_pbfd;
}