Discussion:
issue with flat binaries on sh2 big endian target
(too old to reply)
Waldemar Brodkorb
2016-12-19 19:42:50 UTC
Permalink
Hi,

I try to run a simple hello world program on a Numato Mimasv2
FPGA board with J2 bitstream. It is a slightly modified sh2
architecture.

See here for more information: http://j-core.org

The board is working fine with a musl FDPIC system.

I am trying to use a uClibc-ng (git master) toolchain with elf2flt
(git a87f68ae9e879360a9624f2a02999e67cfbe5a2f is used) with
a small patch attached, to recognize big endian.

Furthermore I am attaching the verbose elf2flt output while
compiling the helloworld source code.

On bootup I get following after patching the 4.9 Linux kernel
with the flat-debug patch (from an old discussion about ARM noMMU
problems) and flthdr -k call on the binary:

[ 4.170119] binfmt_flat: Loading file: /sbin/init
[ 4.196837] binfmt_flat: Mapping is 12168000, Entry point is 44,
data_start is 1240
[ 4.238923] binfmt_flat: Load /sbin/init: TEXT=12168040-12169240
DATA=12169260-121693c4 BSS=121693c4-1216b410
[ 4.298258] binfmt_flat: reloc[24] outside program 0xffffef50 (0
- 0x33b0/0x1200), killing init!
[ 4.351864] Failed to execute /sbin/init (error -8)

Any ideas what is wrong?

DOPIC is disabled in uClibc-ng config and I removed a -fpic in
gcc 6.2.0 so that libgcc isn't compiled as position independent
code.

best regards
Waldemar
Waldemar Brodkorb
2017-02-10 07:13:03 UTC
Permalink
Hi,

ping?

Any help is appreciated,
Waldemar
Post by Waldemar Brodkorb
Hi,
I try to run a simple hello world program on a Numato Mimasv2
FPGA board with J2 bitstream. It is a slightly modified sh2
architecture.
See here for more information: http://j-core.org
The board is working fine with a musl FDPIC system.
I am trying to use a uClibc-ng (git master) toolchain with elf2flt
(git a87f68ae9e879360a9624f2a02999e67cfbe5a2f is used) with
a small patch attached, to recognize big endian.
Furthermore I am attaching the verbose elf2flt output while
compiling the helloworld source code.
On bootup I get following after patching the 4.9 Linux kernel
with the flat-debug patch (from an old discussion about ARM noMMU
[ 4.170119] binfmt_flat: Loading file: /sbin/init
[ 4.196837] binfmt_flat: Mapping is 12168000, Entry point is 44,
data_start is 1240
[ 4.238923] binfmt_flat: Load /sbin/init: TEXT=12168040-12169240
DATA=12169260-121693c4 BSS=121693c4-1216b410
[ 4.298258] binfmt_flat: reloc[24] outside program 0xffffef50 (0
- 0x33b0/0x1200), killing init!
[ 4.351864] Failed to execute /sbin/init (error -8)
Any ideas what is wrong?
DOPIC is disabled in uClibc-ng config and I removed a -fpic in
gcc 6.2.0 so that libgcc isn't compiled as position independent
code.
best regards
Waldemar
<0001-fix-sh2-toolchain-building.patch>
<log>
_______________________________________________
uClinux-dev mailing list
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
http://mailman.uclinux.org/mailman/options/uclinux-dev
_______________________________________________
uClinux-dev mailing list
uClinux-***@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-***@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Loading...