ppc64 ld -r toc check
Alan Modra
amodra@gmail.com
Sat Oct 15 08:07:00 GMT 2011
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
More information about the Binutils
mailing list