Helllo,

I am upgrading our uClinux distribution from 2.4.22 to 2.4.34, using the latest 
releases (or I think so: uClinux-dist-20080808.tar.gz and 
m68k-uclinux-tools-20061214.sh), for our 5272-based custom board.

The kernel compilation finally went fine after I included the different bits 
related to our board (specific drivers, minor hacks, and userland utilities). 
We also have a quite large C++ application (circa half a meg, binary size) 
which is compiled apart from the uClinux tree, plus a smaller one (22k).

The smaller one compiles and runs fine. It uses the same compilation switches 
as the bigger one.

The bigger one either won't pass the compilation step or won't run:
* if I append the -msep-data flag, the program can be built. However when I run 
it, I get "BINFMT_FLAT: reloc outside program" errors, followed by a SIGSEGV
* if I don't use that switch, the compiler issues a " text=0x85c20 overlaps 
data=0x0" error.

Help has been requested here a few times for both issues:
* adding the -msep-data switch is wrong, for I use m68k and gcc 4.1.1
* The runtime relocation error is often the consequence of libraries built with 
-msep-data.

So I leave the -msep-data switch out, and focus on the compile-time error.

The only external lib I use is uClibc. Someone advised here to edit config.arch 
in our vendors directory, in order to disable XIP and shared libraries. I have 
un-commented these lines:
DISABLE_XIP = 1
DISABLE_MOVE_RODATA = 1  (for this one I tried both to enable and disable)
DISABLE_SHARED_LIB = 1
For each test, I do a "make clean" and rebuild. Same for my program.
The most puzzling thing is that the m68k-uclinux-objdump output shows correct 
figures, AFAICT (see below)

I ran out of clues. Any help appreciated.

        Regards.

---
* compilation:
* (parts)
m68k-uclinux-g++ -m5307 obj.cpp -c -NDEBUG -I/home/my/uClinux-dist/include 
-Wall ->overloaded-virtual -o obj.o
* (final
m68k-uclinux-g++ -m5307 -L/home/my/uClinux-dist/uClibc/ -lc -lgcc -lstdc++ 
-Wl,-elf2flt lots.o of.o obj.o files.o -o myprog
ERROR: text=0x85c20 overlaps data=0x0
collect2: ld returned 1 exit status

* objdump:

m68k-uclinux-objdump -h myprog.elf ( main sections)
Idx     Name            Size            VMA             LMA             File 
off                Algn
303     .text           00085c20        00000000        00000000        
000009cac               2**2
607     .data           0000d7a0        00085c20        00085c20        
000887f0                2**2
608     .bss            00001380        000933c0        000333c0        
00095f90                2**0
609     .stack  00000000        00000008        00000008        00095f90        
        2**0

m68k-uclinx-objdump -h myprog.gdb (gives other figures)
Idx     Name            Size            VMA             LMA             File 
off                Algn
0       .text           00087700        00000000        00000000        0002000 
        2**2
1       .data           0000de30        00087700        00087700        
00089700                2**2
2       .bss            00001380        00095530        00095530        
00097530                2**2
3       .stack  00000000        00000000        00000000        00097530        
        2**0

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to