aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-06-25 05:20:57 +0000
committerAlan Modra <amodra@gmail.com>2010-06-25 05:20:57 +0000
commitba761f19f5658feaff39b69c0bdc84b8716cd3f9 (patch)
tree16f9055ee52f67720a5b6b08bbb90d2b24ce6419 /ld/emultempl
parentbded3693aef88c180260497e078c57d5e86a9ea4 (diff)
downloadgdb-ba761f19f5658feaff39b69c0bdc84b8716cd3f9.zip
gdb-ba761f19f5658feaff39b69c0bdc84b8716cd3f9.tar.gz
gdb-ba761f19f5658feaff39b69c0bdc84b8716cd3f9.tar.bz2
include/elf/
* ppc64.h (R_PPC64_LO_DS_OPT): Define. bfd/ * elf64-ppc.c (toc_skip_enum): Define. (ppc64_elf_edit_toc): Use two low bits of skip array as markers. Optimize largetoc sequences. (adjust_toc_syms): Update for skip array change. (ppc64_elf_relocate_section): Handle R_PPC64_LO_DS_OPT. ld/ * emultempl/ppc64elf.em (prelim_size_sections): New function. (ppc_before_allocation): Use it. Size sections before toc edit too.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/ppc64elf.em30
1 files changed, 21 insertions, 9 deletions
diff --git a/ld/emultempl/ppc64elf.em b/ld/emultempl/ppc64elf.em
index f8604a6..46d0332 100644
--- a/ld/emultempl/ppc64elf.em
+++ b/ld/emultempl/ppc64elf.em
@@ -227,6 +227,19 @@ sort_toc_sections (lang_statement_list_type *list,
}
static void
+prelim_size_sections (void)
+{
+ if (expld.phase != lang_mark_phase_enum)
+ {
+ expld.phase = lang_mark_phase_enum;
+ expld.dataseg.phase = exp_dataseg_none;
+ one_lang_size_sections_pass (NULL, FALSE);
+ /* We must not cache anything from the preliminary sizing. */
+ lang_reset_memory_regions ();
+ }
+}
+
+static void
ppc_before_allocation (void)
{
if (stub_file != NULL)
@@ -240,21 +253,20 @@ ppc_before_allocation (void)
{
/* Size the sections. This is premature, but we want to know the
TLS segment layout so that certain optimizations can be done. */
- expld.phase = lang_mark_phase_enum;
- expld.dataseg.phase = exp_dataseg_none;
- one_lang_size_sections_pass (NULL, TRUE);
+ prelim_size_sections ();
if (!ppc64_elf_tls_optimize (&link_info))
einfo ("%X%P: TLS problem %E\n");
-
- /* We must not cache anything from the preliminary sizing. */
- lang_reset_memory_regions ();
}
if (!no_toc_opt
- && !link_info.relocatable
- && !ppc64_elf_edit_toc (&link_info))
- einfo ("%X%P: can not edit %s %E\n", "toc");
+ && !link_info.relocatable)
+ {
+ prelim_size_sections ();
+
+ if (!ppc64_elf_edit_toc (&link_info))
+ einfo ("%X%P: can not edit %s %E\n", "toc");
+ }
if (!no_toc_sort)
{