public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ppc64 ld -r toc check
@ 2011-10-15  8:07 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2011-10-15  8:07 UTC (permalink / raw)
  To: binutils

On Fri, Oct 14, 2011 at 08:54:31PM -0500, Peter Bergner wrote:
>     /opt/at5.0/bin/ld: TOC section size exceeds 64k
> 
> Is that possible for a compiler that defaults to -mcmodel=medium?

Linker bug.  See ppc64elf.em:gld${EMULATION_NAME}_finish where I check
the toc size with no regard to what sort of toc we have.  Trouble is,
we do no reloc analysis on ld -r to determine the code model.  I think
I'll just have to remove the test.  People still using -mcmodel=small
with ld -r will just discover they have overflowed the toc later, at
final link.  Too bad for them.  ld -r is a bad choice of packaging tool.

	* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Remove toc check.

Index: ld/emultempl/ppc64elf.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/ppc64elf.em,v
retrieving revision 1.77
diff -u -p -r1.77 ppc64elf.em
--- ld/emultempl/ppc64elf.em	10 Oct 2011 09:05:40 -0000	1.77
+++ ld/emultempl/ppc64elf.em	15 Oct 2011 07:54:32 -0000
@@ -530,14 +530,6 @@ gld${EMULATION_NAME}_finish (void)
      descriptor in the .opd section.  */
   entry_section = ".opd";
 
-  if (link_info.relocatable)
-    {
-      asection *toc = bfd_get_section_by_name (link_info.output_bfd, ".toc");
-      if (toc != NULL
-	  && bfd_section_size (link_info.output_bfd, toc) > 0x10000)
-	einfo ("%X%P: TOC section size exceeds 64k\n");
-    }
-
   if (stub_added)
     {
       char *msg = NULL;

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-15  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-15  8:07 ppc64 ld -r toc check Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).