From 1876a542175ef438d6aaafeccb479024994b938d Mon Sep 17 00:00:00 2001 From: Cl?ment Chigot Date: Wed, 20 Apr 2022 15:07:50 +0100 Subject: 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. --- include/ChangeLog | 5 +++++ include/coff/xcoff.h | 7 +++++++ 2 files changed, 12 insertions(+) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index c40136e..5cf3fa7 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2022-04-20 Clément Chigot + + * coff/xcoff.h (struct xcoff_loader_info): Add ldrel_count and + libpath fields. + 2022-04-07 Mark Harmstone * coff/i386.h: Define R_SECTION. diff --git a/include/coff/xcoff.h b/include/coff/xcoff.h index acadf54..0770d04 100644 --- a/include/coff/xcoff.h +++ b/include/coff/xcoff.h @@ -432,6 +432,10 @@ struct xcoff_loader_info /* Number of ldsym structures. */ size_t ldsym_count; + /* A count of non TOC relative relocs which will need to be + allocated in the .loader section. */ + size_t ldrel_count; + /* Size of string table. */ size_t string_size; @@ -440,6 +444,9 @@ struct xcoff_loader_info /* Allocated size of string table. */ size_t string_alc; + + /* The libpath being used. */ + const char *libpath; }; /* In case we're on a 32-bit machine, construct a 64-bit "-1" value -- cgit v1.1