From 1bbe090216c757ccf79f3860b7db2ad660feb492 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 15 Mar 2010 01:59:57 +0000 Subject: [PATCH] * elf64-ppc.c (ppc64_elf_has_small_toc_reloc): New function. * elf64-ppc.h (ppc64_elf_has_small_toc_reloc): Declare. --- bfd/ChangeLog | 5 +++++ bfd/elf64-ppc.c | 10 ++++++++++ bfd/elf64-ppc.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index e0260f76334..ae895d98a74 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2010-03-15 Alan Modra + + * elf64-ppc.c (ppc64_elf_has_small_toc_reloc): New function. + * elf64-ppc.h (ppc64_elf_has_small_toc_reloc): Declare. + 2010-03-14 Alan Modra PR ld/11378 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 1834e22527c..6c4ff4c4559 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -8274,6 +8274,16 @@ ppc64_elf_edit_toc (struct bfd_link_info *info) return TRUE; } +/* Return true iff input section I references the TOC using + instructions limited to +/-32k offsets. */ + +bfd_boolean +ppc64_elf_has_small_toc_reloc (asection *i) +{ + return (is_ppc64_elf (i->owner) + && ppc64_elf_tdata (i->owner)->has_small_toc_reloc); +} + /* Allocate space for one GOT entry. */ static void diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index b6bc5fb21c6..c905d30cc9e 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -29,6 +29,8 @@ bfd_boolean ppc64_elf_tls_optimize (struct bfd_link_info *); bfd_boolean ppc64_elf_edit_toc (struct bfd_link_info *); +bfd_boolean ppc64_elf_has_small_toc_reloc + (asection *); bfd_vma ppc64_elf_toc (bfd *); int ppc64_elf_setup_section_lists -- 2.30.2