aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorCl?ment Chigot <clement.chigot@atos.net>2022-04-20 15:07:50 +0100
committerNick Clifton <nickc@redhat.com>2022-04-20 15:07:50 +0100
commit1876a542175ef438d6aaafeccb479024994b938d (patch)
tree1a60756413f36963d9fded458ae99cb84135373a /ld
parent3b70bcb00f443259b444b3fc543899047ac7f44e (diff)
downloadgdb-1876a542175ef438d6aaafeccb479024994b938d.zip
gdb-1876a542175ef438d6aaafeccb479024994b938d.tar.gz
gdb-1876a542175ef438d6aaafeccb479024994b938d.tar.bz2
Stubs (added in a later patch) will generate new .loader symbols, once the allocations have been done. Thus, the .loader section cannot be layout before that.
bfd/ChangeLog: * coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Write len in ldinfo->strings instead of directly in the output_bfd. * coff64-rs6000.c (_bfd_xcoff64_put_ldsymbol_name): Likewise. * xcofflink.c (struct xcoff_link_hash_table): Remove ldrel_count field. Add ldinfo field. (xcoff_mark_symbol): Adjust to new ldinfo field. (xcoff_mark): Likewise. (bfd_xcoff_link_count_reloc): Likewise. (xcoff_build_loader_section): Split into two functions: one that build the loader section (this function) and one that only size it... (xcoff_size_loader_section): ... (this function). (bfd_xcoff_size_dynamic_sections): Adapt to new ldinfo field. Move the part where the dynamic sections are build to ... (bfd_xcoff_build_dynamic_sections): ... this function. * xcofflink.h: Add bfd_xcoff_build_dynamic_sections prototype. include/ChangeLog: * coff/xcoff.h (struct xcoff_loader_info): Add ldrel_count and libpath fields. ld/ChangeLog: * emultempl/aix.em (_after_allocation): New function.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog4
-rw-r--r--ld/emultempl/aix.em9
2 files changed, 13 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 1538f42..285aae9 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
+2022-04-20 Clément Chigot <clement.chigot@atos.net>
+
+ * emultempl/aix.em (_after_allocation): New function.
+
2022-04-07 Mark Harmstone <mark@harmstone.com>
* testsuite/ld-pe/secidx1.s: New test source file.
diff --git a/ld/emultempl/aix.em b/ld/emultempl/aix.em
index 6807aae..3878d58 100644
--- a/ld/emultempl/aix.em
+++ b/ld/emultempl/aix.em
@@ -1009,6 +1009,14 @@ gld${EMULATION_NAME}_before_allocation (void)
before_allocation_default ();
}
+static void
+gld${EMULATION_NAME}_after_allocation (void)
+{
+ /* Now that everything is in place, finalize the dynamic sections. */
+ if (!bfd_xcoff_build_dynamic_sections (link_info.output_bfd, &link_info))
+ einfo (_("%F%P: failed to layout dynamic sections: %E\n"));
+}
+
static char *
gld${EMULATION_NAME}_choose_target (int argc, char **argv)
{
@@ -1607,6 +1615,7 @@ LDEMUL_AFTER_OPEN=gld${EMULATION_NAME}_after_open
LDEMUL_SET_OUTPUT_ARCH=gld${EMULATION_NAME}_set_output_arch
LDEMUL_CHOOSE_TARGET=gld${EMULATION_NAME}_choose_target
LDEMUL_BEFORE_ALLOCATION=gld${EMULATION_NAME}_before_allocation
+LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation
LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=gld${EMULATION_NAME}_create_output_section_statements
LDEMUL_OPEN_DYNAMIC_ARCHIVE=gld${EMULATION_NAME}_open_dynamic_archive
LDEMUL_PARSE_ARGS=gld${EMULATION_NAME}_parse_args