vlink

A portable linker for multiple file formats.
Valid HTML 4.01!
About vlink
Last release source
Daily source snapshot
Tagged source archives
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.


12-Mar-2016: vlink 0.15a.
  • New option -mrel instructs the linker to merge all sections with PC-relative references between them. This was done automatically in previous versions, but makes no sense for most targets.
  • New option -hunkattr, which assigns memory attributes to an input section name. The memory attributes of all those input sections will be overwritten.
  • (elf) Introduced the new target "elf32jag", an unofficial ELF target for the Atari Jaguar RISC CPU.
  • (ados/ehf) Read/write extended memory attributes (0xc0000000 in hunk type or size). Extended attributes in object files seem inofficial, but supported by vasm now.
  • (ados/ehf) Allow memory flags with HUNK_PPC_CODE in object files.
  • (ados/ehf) Support HUNK_RELRELOC32 in executables (since OS3.0).
  • (a.out) Fixed pc-relative relocations in relocatable object file output.


28-Dec-2014: vlink 0.15.
  • (ados/ehf) Support for SAS/C style indexed libraries (HUNK_LIB).
  • (ados/ehf) -Csasc is accepted to build a table with SAS/C constructors and destructors. It looks for functions named __STI_... and __STD_...
  • (tos) New option -tos-textbased to write symbol offsets which are based on the text section (MonST-comaptible).
  • (tos) text and data section size in the header must not be odd.
  • (aoutmint) text and data section size in the header must not be odd.


07-Jun-2014: vlink 0.14d.
  • (vobj) Fixed reading common symbols from VOBJ files.
  • (a.out) Fixed detection of Atari Jaguar MOVEI relocations.
  • (tos) Label values from the symbol table must be an offset to the section they are defined in.


27-Dec-2013: vlink 0.14c.
  • (ados/ehf) Ignore FILE and SECTION symbols, when converting from a different format. They have no meaning here.


31-Aug-2013: vlink 0.14b.
  • Fixed potential illegal memory accesses when reading unallocated amigahunk/ehf or a.out BSS sections.
  • Also delete empty sections with symbols, provided they are unreferenced and stripped.
  • Fixed symbol assignments in the linker script's section definitions. Defining symbols before the first input section pattern didn't work.
  • Make sure that pc-relative relocations are resolved when the target symbol is in the same output section, even when -q (keep relocs) is given.
  • New option -osec, which makes some target formats output each section as an individual file. Currently valid for: rawbin1, rawbin2, amsdos, cbmprg. -osec=basename can be used to put "basename." in front of each output file name (section name).
  • Allow '.' symbol in a linker script's MEMORY block, to refer to the start address given by -Ttext.
  • (elf) Display an error when a section doesn't cleanly attach to a program segment.
  • (a.out) Fixed reading of empty objects, without any symbols.
  • (aoutmint) Make sure that TOS symbol table length is zero, when there are no symbols.
  • (vobj) Fixed sign-extension of relocation addends and masks. This had for example the effect that 16-bit PC-relative overflows were not recognized.
  • (rawbin) Extended the default script (.rodata, COMMON, .comment).
  • (rawbin) Special default linker script for amsdos, supporting banks.


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

$Id: index.php,v 1.12 2015/07/26 13:21:37 frank Exp $