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.


08-Aug-2012: vlink 0.14a.
  • New output format: amsdos, for Amstrad/Schneider CPC computers.
  • New output format: cbmprg, for Commodore 8-bit computers (PET, VIC-20, 64, etc.).
  • The output formats rawbin2, amsdos and cbmprg will use the section name instead of the section's base address as file name appendix for additional files.
  • When using a linker script the input sections will be grouped by type (code, data, bss) when being merged into a pattern-matched output section. This keeps uninitialized parts together and is required to form data-bss sections.
  • The binary output formats will display a fatal error when sections are overlapping. This could cause crashes or huge output files before.
  • Fixed syntax and type errors in dir.c when compiling for Windows (introduced in 0.14).
  • New linker-script command: ASSERT(), to generate a fatal error when the tested expression is zero.
  • New linker-script functions: MAX(a,b) and MIN(a,b) to return the higher or lower of two values.
  • (ados/ehf) A section named "BSS" is no longer automatically merged with other bss-type sections.
  • (vobj) Regard all information from an object as unsigned, except symbol values and reloc addends and masks.


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).
Aktion UBERWACH!

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