[uClinux-dev] SSHD in MicroBlaze: BINFMT_FLAT: reloc outside program

John Williams jwilliams at itee.uq.edu.au
Mon Jan 23 21:48:24 EST 2006


Hi Prasad,

DeviPrasad Natesan wrote:

> =======================================
> RELOC[373]: offset=0x2ab0 symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0x2ab0)
> RELOC[554]: offset=0x4a50 symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0x4a50)
> RELOC[719]: offset=0x787c symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0x787c)
> RELOC[765]: offset=0x7ea4 symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0x7ea4)
> RELOC[824]: offset=0x9368 symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0x9368)
> RELOC[1261]: offset=0xf300 symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0xf300)
> RELOC[1312]: offset=0xffc8 symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0xffc8)
> RELOC[1798]: offset=0x160d0 symbol=options+0x9594 section=.bss size=4
> fixup=0x1577a4 (reloc=0x160d0)
> ===========================================================

Hmm - it looks like elf2flt is deliberately generating this reloc - the
question is why?

You need to find which symbol is the subject of the reloc.

Use "mb-objdump -t sshd.gdb > sshd.dump" to generate a full symbol dump.
 Then, find the address of the symbol called "options" - add the 0x9594
offset to it, and see where it points.

It's a bit strange to me that this reloc is in the .bss segment - that's
where the application stack lives.  Does sshd use some massive local
variables declared off the stack (or perhaps, the "alloca()" function)?

A long shot, but maybe worth increasing the application stack size,
either with FLTFLAGS += -s XXXXXXXX (where XXXXXX is some nice big
number, say 32K or more), or by using mb-flthdr to adjust it
retrospectively.

> BTW, my root file system is in jffs2 based flash partition and it is
> read-only (and i used u-boot to boot the linux from the file system).
> So the possibility of other program corrupting the relocation
> information in the header in the file is nil (am i right?).

Yes, I think you are correct here.

Regards,

John



More information about the uClinux-dev mailing list