diff options
author | Alan Modra <amodra@gmail.com> | 2014-02-12 16:44:36 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-02-12 22:10:09 +1030 |
commit | 795bc6b3eac9e3f80279df69c05d70fc44eaaa4c (patch) | |
tree | 05936288596641f8b197892fe10826ead1935987 /ld/emultempl | |
parent | b407645f7ef086a9a527c8f62499b4255868e748 (diff) | |
download | gdb-795bc6b3eac9e3f80279df69c05d70fc44eaaa4c.zip gdb-795bc6b3eac9e3f80279df69c05d70fc44eaaa4c.tar.gz gdb-795bc6b3eac9e3f80279df69c05d70fc44eaaa4c.tar.bz2 |
Enable ppc476 workaround for ld -r.
The Linux kernel builds modules using ld -r. These might need the
ppc476 workaround, so enable it for ld -r if sections have sufficient
alignment to tell location within a page.
bfd/
* elf32-ppc.c (ppc_elf_relax_section): Enable ppc476 workaround
for ld -r, when code sections are sufficiently aligned.
* elf32-ppc.h (struct ppc_elf_params): Delete pagesize. Add
pagesize_p2.
ld/
* emultempl/ppc32elf.em (pagesize): New static var.
(ppc_after_open_output): Set params.pagesize_p2 from pagesize.
(PARSE_AND_LIST_ARGS_CASES): Adjust to use pagesize.
Diffstat (limited to 'ld/emultempl')
-rw-r--r-- | ld/emultempl/ppc32elf.em | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em index afa85ff..8de230a 100644 --- a/ld/emultempl/ppc32elf.em +++ b/ld/emultempl/ppc32elf.em @@ -39,6 +39,8 @@ static int notlsopt = 0; /* Choose the correct place for .got. */ static int old_got = 0; +static bfd_vma pagesize = 0; + static struct ppc_elf_params params = { PLT_UNSET, -1, 0, 0, 0, 0 }; static void @@ -46,8 +48,9 @@ ppc_after_open_output (void) { if (params.emit_stub_syms < 0) params.emit_stub_syms = link_info.emitrelocations || link_info.shared; - if (params.pagesize == 0) - params.pagesize = config.commonpagesize; + if (pagesize == 0) + pagesize = config.commonpagesize; + params.pagesize_p2 = bfd_log2 (pagesize); if (link_info.relocatable) params.ppc476_workaround = 0; ppc_elf_link_params (&link_info, ¶ms); @@ -267,10 +270,10 @@ PARSE_AND_LIST_ARGS_CASES=${PARSE_AND_LIST_ARGS_CASES}' if (optarg != NULL) { char *end; - params.pagesize = strtoul (optarg, &end, 0); + pagesize = strtoul (optarg, &end, 0); if (*end - || (params.pagesize < 4096 && params.pagesize != 0) - || params.pagesize != (params.pagesize & -params.pagesize)) + || (pagesize < 4096 && pagesize != 0) + || pagesize != (pagesize & -pagesize)) einfo (_("%P%F: invalid pagesize `%s'\''\n"), optarg); } break; |