All of lore.kernel.org
 help / color / mirror / Atom feed
* GNU gcc ld script problem
@ 2004-02-05  1:24 Nathan Field
  2004-02-05  4:13 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Field @ 2004-02-05  1:24 UTC (permalink / raw)
  To: linux-mips

	This seems like a problem specific to the linker, but it's also so
specific to linux and MIPS that I decided to send it here first. If I was
wrong to do that let me know and I'll send it to bug-binutils@gnu.org 
instead.

	Anyway, I think I've found a problem in the ld scripts for MIPS.
Basically the built in script don't seem to fill in a .plt section. So if
I do this:

mips-linux-gcc prog.c
mips-linux-objdump -h a.out | grep plt

I get no output, but if I use my modified linker script I get this:

mips-linux-gcc -T tmp.ld prog.c
mips-linux-objdump -h a.out | grep plt
 10 .plt          00000030  0040052c  0040052c  0000052c  2**2

which I believe is the correct output. The change that I made was to move
.stub sections into the .plt from the .text section. So this:

  .plt            : { *(.plt) }
  .text           :
  {
    _ftext = . ;
    *(.text .stub .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
    *(.mips16.fn.*) *(.mips16.call.*)
  } =0

became this:

  .plt            : { *(.plt .stub) }
  .text           :
  {
    _ftext = . ;
    *(.text .text.* .gnu.linkonce.t.*)
    /* .gnu.warning sections are handled specially by elf32.em.  */
    *(.gnu.warning)
    *(.mips16.fn.*) *(.mips16.call.*)
  } =0

If anyone needs more information on this issue just let me know. It has
been in the MIPS tools for a while. I have been working from a recent 
snapshot:

59) ./mips-linux-ld -v
GNU ld version 040121 20040121

but the same issue was around way back when (MontaVista preview kit 2.1):

61) /opt/hardhat/previewkit/mips/fp_be/bin/mips_fp_be-ld -v
GNU ld version 2.10.91 (with BFD 2.10.91.0.2)

Does anyone here have the knowledge to confirm that my changes are correct 
and commit privileges to the binutils tree?

	nathan

-- 
Nathan Field (ndf@ghs.com)			          All gone.

But the trouble with analogies is that analogies are like goldfish:
sometimes they have nothing to do with the topic at hand.
        -- Crispin (from a posting to the Bugtraq mailing list)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-02-05  4:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-05  1:24 GNU gcc ld script problem Nathan Field
2004-02-05  4:13 ` Daniel Jacobowitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.