m68k-elf-tools -------------- Files: tools-20010712 - the source, doc and build scripts for the tools m68k-elf-tools-20010712.tar.gz - A tar (relative to /) of the tools. It includes gcc, g++, binutils, genromfs, flthdr and elf2flt. It doesn't have m68k-elf-gdb at this point. 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: * 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 three files: c - the flat executable to put in the romfs c.gdb - run gdb on this file when debugging the application c.elf - the fully linked/relocatable elf file How to install: login as root cd / tar xvzf m68k-elf-tools-20010610.tar.gz ensure "/usr/local/bin" is in your path. How to build your own: Read through the intro in "tools-20010610/build-m68k-elf.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. 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.