vlink

A portable linker for multiple file formats.
Valid HTML 4.01!
About vlink
Last release source
Daily source snapshot
Compilation notes
vlink docs (pdf)
Volker's vlink page
vbcc/Amiga home page

vlink is a portable linker, written in ANSI-C, that can read and write a wide range of object- and executable file formats. It can be used to link a specific target format from several different input file formats, or for converting, stripping and manipulating files.

The linker can be controlled by GNU-style linker scripts to generate absolute code, but it also runs very well with default rules to create relocatable executables, as required for AmigaOS or MorphOS.

Of course there might be technical restrictions that object files of different architectures cannot be merged because of incompatible relocation types, differing endianess or symbol-names with and without leading underscores. But in theory everything is possible!

Currently the following object and executable file formats are supported by vlink:
  • ELF 32bit PowerPC big endian
  • ELF 32bit PowerPC AmigaOS (special dynamic linking rules)
  • ELF 32bit PowerPC MorphOS (relocatable executables)
  • ELF 32bit PowerPC PowerUp (relocatable executables)
  • ELF 32bit M68k big endian
  • ELF 32bit x86 little endian
  • ELF 32bit x86 AROS (relocatable executables)
  • ELF 32bit ARM little endian
  • ELF 64bit x86_64 little endian
  • a.out Sun/010 (also Amiga/Atari 68000)
  • a.out Sun/020 (also Amiga/Atari 68020+)
  • a.out MiNT (embedded in Atari TOS format)
  • a.out Jaguar (M68k with support for RISC relocations)
  • a.out NetBSD/68k (4k and 8k pages)
  • a.out NetBSD/386
  • a.out PC/386
  • a.out generic
  • AmigaOS hunk format
  • EHF, extended hunk format (WarpOS)
  • Atari TOS format (writing only)
  • Motorola S-Records (writing only)
  • Intel-hex format (writing only)
  • AMSDOS format (Amstrad/Schneider CPC)
  • Commodore 8-bit PRG format
  • Raw binaries (writing only)
  • VOBJ, proprietary versatile object format (reading only)
Note: There are currently no binaries available for download, besides those included in a vbcc release. But you might want to download the latest source archive and build a binary yourself.


05-Aug-2011: vlink 0.14.
  • (elf) Introduced a module with common functions for ELF32 and ELF64, then added experimental ELF64 support. First ELF64 test target is: elf64x86.
  • (ados/ehf) The new option -da forces the linker to allocate all PowerOpen address symbols (@_sybmol) which point to an already known symbol, which was only done before when generating an amigaehf executable.
  • Improved Unix path conversion into native AmigaOS or DOS format.
  • Runs on plain Atari TOS.
  • Add -dc and -dp as synonyms for -d (BSD ld compatibility).


01-Dec-2010: vlink 0.13.
  • Fixed some NULL-pointer accesses when parsing bad linker scripts.
  • New option -export-dynamic puts all global symbols of the output file into the dynamic symbol table, making them visible for shared objects loaded on demand (e.g. by dlopen()).
  • When creating a shared object, do not export unused symbols from static link libraries as dynamic symbols. This could even lead to a crash.
  • Make sure a symbol value is always correctly sign-extended to 64 bit, which was a problem with ELF and a.out backends.
  • (elf32ppc) Fixed writing of MorphOS ddrelocs on a little-endian host.


09-Jun-2010: vlink 0.12g.
  • Option -y only reports symbol references which will be part of the resulting output file.
  • (a.out) Also handle indirect symbols with N_EXT bit set.
  • (elf) Automatically add a default PT_PHDR, when a PHDRS block in a linker script doesn't define it although it was requested to be part of a PT_LOAD PHDR.
  • (elf) Ignore R_NONE relocations. No longer fail on it.
  • (elf) Introduced the new target "elf32amigaos" for AmigaOS4. The only difference to the standard "elf32ppcbe" is that even references from a shared object (to other shared objects) have to be resolved at link time.


14-Jul-2009: vlink 0.12f.
  • Do not set the executable flag of the target file before it is closed. This prevents exclusive locking problems with some file systems (e.g. with JXFS from AmigaOS4).


02-Jul-2009: vlink 0.12e.
  • Multiple definitions of absolute symbols are ignored, when all have the same value.
  • Replaced #ifdef WIN32 by _WIN32.
  • (elf) Fixed an error when creating executables with the default 2-segment layout, while one segment remains empty (e.g. only .text and .rodata).


05-May-2009: vlink 0.12d.
  • (a.out) New format aoutnull, which is the default format with undefined endianess and standard relocations, when an object with MID 0 is read.
  • (a.out) New format aoutjaguar, which recognizes swapped 16-bit words and generates a special relocation for the Jaguar GPU MOVEI RISC instruction (indicated by a set COPY flag in the reloc-info field).
  • (a.out) Detects Jaguar GPU MOVEI relocations in objects with MID 0 and treats them accordingly to write a correct desintation file.
  • When none of the input files sets a valid endianess use the endianess of the output file format. When the endianess is still unknown, guess it by using the endianess of the host system.
  • New options -EB and -EL to define the endianess for reading input files and writing the output. Useful when neither the input files nor the output file defines a valid endianess.
  • New option -minalign sets a minimum alignment (number of bits which have to be zero) for all imported sections. The specified alignment value will only take effect when higher than the section's current alignment. It defaults to 0.
Aktion UBERWACH!

$Id: index.php,v 1.11 2009/11/05 14:37:42 frank Exp $