[Milkymist-devel] Milkymist software task list
Sébastien Bourdeauducq
sebastien.bourdeauducq at lekernel.net
Fri Mar 19 07:01:14 PDT 2010
On Thursday 18 March 2010 16:25:30 you wrote:
> What is the status of the FDPIC stuff?
Currently, we still use the Theobroma code, which makes GNU LD emit a
relocation section using -Wl,-q (normally not present in executables). Then
the kernel reads that section and patches the memory addresses in the code and
the data so that the program can execute from whatever memory location the
kernel loaded it into.
In normal FDPIC:
1/ only the data is patched, not the code (no .text relocations)
2/ the absence of .text relocations enable sharing of this section between
different copies of the same program or library: executables (and libraries)
load faster and use less memory
3/ patching is done by the C library, not the kernel
4/ the relocation information does not come from a relocation section
generated by -Wl,-q but from something similar to what normal shared libraries
use. GCC should be called with the -fPIC flag. I currently do not fully
understand that last part plus it looks like support for it in the LM32 GNU
toolchain is broken.
The job would be to:
* remove the code patcher from the kernel. I already did it in the old kernel
(2.6.23):
http://github.com/lekernel/milkymist-linux/compare/master...newbinutils
I am not completely sure about the correctness of this code.
* write a LM32 loader for uClibc. This does not look so hard: architectures
with good FDPIC support like FRV and Blackfin seem to have a lot of code in
common for this part.
* the tedious part: get the GNU toolchain to produce appropriate relocation
information.
If you can understand those, here are some pretty cryptic FDPIC documentations
for other architectures:
http://ftp.redhat.com/redhat/gnupro/FRV/FDPIC-ABI.txt
http://ftp.redhat.com/redhat/gnupro/FRV/FDPIC-ABI-TLS.txt
http://sourceware.org/ml/binutils/2008-02/msg00281.html
Thanks,
Sébastien
More information about the Devel
mailing list