uClinux-tools ------------- Files: tools-20020410 - the source, doc and build scripts for the tools m68k-elf-tools-20020410.tar.gz arm-elf-tools-20011219.tar.gz (still the same, no changes needed) - A tar (relative to /) of the tools. It includes gcc, g++, binutils, genromfs, flthdr and elf2flt. Changes from uclinux-elf-tools-20020218: * Changes to compiler to support flat format shared libraries. Adds -mid-shared-library, -mshared-library-id, and -shared-lib-id. * Adds previously missing man pages and an m68k-bdm-elf-gdb. Changes from uclinux-elf-tools-20011219: * Fix bug with PIC code (-msep-data) in the m68k tools that prevents functions that return structures from working. In fact they usually crash. This was particularly noticeable with the std C++ libraries. The change is in gcc-2.95.3-full.patch. * Update the build script to work with the latest elf2flt from CVS and the latest 0.5.1 release of genromfs from http://romfs.sourceforge.net * You can now build the tools without being root by specifying a different PREFIX for the install directory. Read the DOC at the top of the script for details. Changes from m68k-elf-tools-20010716: * Integrated v850 changes into elf2flt * Added ARM target to build script. Suppport for normal and XIP operation and also C++. One compiler fits all (kernel and user). * support for compressed data segments, saves ROM space when using XIP. * flthdr has undergone some changes, it works on multiple files now. * support for compressed data/relocs flat files primarily for use with XIP/PIC flat files. * fixes to work with latest uClibc. * changes to ld-elf2flt to support glibc. * probably a thousand other things I have forgotten :-) Changes from m68k-elf-tools-20010712: * Fixed bug with functions with attribute (noreturn) corrupting the stack. * build-m68k-elf.sh forces kernel source to be configured before running. Changes from m68k-elf-tools-20010610: * Paul has been busy getting all the instruction timings for the 5307 correct. We now have a -m5307 option to enable these. The 5200 timings have also been adjusted. * Now includes all of Dave Fiddes's coldfire patches. * uClibc has the C++ support enabled and so far it looks good with several apps working. Be sure to add "-lstdc++ -lc -lgcc" when building C++ apps. For example: m68k-elf-g++ -Wl,-elf2flt -m5200 -msep-data -o hello hello.cc \ -lstdc++ -lc -lgcc I included a uClibc tarball in case you have problems building with the latest from CVS. * A new tool, flthdr (or m68k-elf-flthdr) which allows you to modify flat files in place. You can change them to load into RAM, compress them or adjust the stack size. It can also print the header, nice for checking what is going on. Check the usage for details. Changes from m68k-elf-tools-20010228: * gcc-2.95.3, still using binutils-2.10 as there as some serious issues with binutils-2.11 when building m68k-coldfire source trees. * fixed bug in elf2flt.ld linker script for C++ apps. * Patch for binutils for PIC compilation to error on oversized "jsr" instructions rather than automatically generate absolute jumps. * Fix "wdebug" instruction for the coldfire. * Add patch for genromfs (../../.. bug) from the professor. * Partial, but not complete start on adding ARM tools and support in elf2flt, someone want to fix the relocations and test it :-) * No longer leave the "*.elf" file, it serves no purpose except to confuse people. * Because elf2flt is arch specific, change it to be m68k-elf-elf2flt so there is no confusion with other tool chains (this is automatic if you are using the -Wl,-elf2flt option). What do you get: * Most of the following is still m68k specific, don't freak out if you are using an ARM, in many cases just change m68k to arm :-) * An m68k-elf compiler for all gcc support m68k architectures and scripts to help you build your own. * A new option for the m68k-elf-gcc, "-msep-data" that turns on "a5" relative data access, PIC code generation and removes the normal "a5" load/unload code on every function entry. Read through the intro to the patch in: tools-20010228/gcc-2.95.2-elfPICgot.patch for more information on the gcc changes. They are basically the same in this version. * A new elf2flt with support for the GOT table relocations in the above output. Command line support for ZFLAT binaries (-z) and a few other options like load to RAM (-r). * Changes to genromfs to allow device node creation without being root. A special empty file with the name "@filename,[cbp..],major,minor" will result in a device node in the generated romfs. * A script that replaces "ld" (ld is now called ld.real) that looks for a '-elf2flt' option, and produces a flat binary if this option is present. It will generate PIC/non-pic as required. It will automatically choose the elf2flt linker script unless you provide your own. To generate a flat file from gcc you will need to run: m68k-elf-gcc -Wl,-elf2flt -o c c.c Without the the "-elf2flt" option you will get normal elf binaries. If you want to do the conversions yourself, see the section later in this file on making flat files. This command will give you two files: c - the flat executable to put in the romfs c.gdb - run gdb on this file when debugging the application * A program called flthdr (m68k-elf-flthdr) that lets you manipulate and display flat file headers. How to install: login as root cd / tar xvzf m68k-elf-tools-20011219.tar.gz or tar xvzf m68k-elf-tools-20011219.tar.gz ensure "/usr/local/bin" is in your path. How to build your own: Read through the intro in "tools-20011219/build-uclinux-tools.sh" Getting started on your own tree: First, you will need to get yourself the latest files from CVS. Both 2.0.x and 2.4.x have flat support for binaries from this toolchain. To patch an existing source base go for just: fs/binfmt_flat.c include/linux/flat.h Files from the older coff tools can still be loaded by this flat loader providing the are using version 2 flat files. The current CVS'd version of uClibc has the crt0.S changes required at startup. If you are already using PIC code then your startup shouldn't have to change much. You may find that your linker scripts needs a little work to support the new elf compiler. Mainly in alignments of sections etc. You will need to add the "-msep-data" option to your build to get working PIC code, you will also have to rebuild your libc and other libraries with this option. The tools tarball has versions of libgcc.a for msep-data/normal builds. You can use the tools build script to generate multilib versions of uClibc and install them in /usr/local if that is what you prefer. For ARM, the options "-fpic" and "-msingle-pic-base" are needed for XIP. Making flat files by hand: If you do not want to use the linker replacement script, but build binaries by hand, then here are the basic steps: To generate a flat file that can do XIP: m68k-elf-gcc -msep-data -m68000 -c test.c m68k-elf-ld.real -d -r test.tmp crt0.o test.o libc.a \ /usr/local/lib/gcc-lib/m68k-elf/2.95.2/m68000/msep-data/libgcc.a m68k-elf-ld.real -T elf2flt.ld -Ur -o test.elf test.tmp m68k-elf-ld.real -T elf2flt.ld -o test.gdb test.tmp elf2flt -o test -p test.gdb test.elf For non-XIP fully relocated binaries change the elf2flt line to: elf2flt -r -o test test.elf You can force an XIP program to be loaded completely into RAM by adding the '-r' option to the elf2flt line. You can compress the flat binary by adding the '-z' option to the elf2flt line. '-z' implies that the binary is loaded into RAM and cannot do XIP. davidm@snapgear.com