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
Last release binaries
Current version binaries
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 Jaguar RISC 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)


16-May-2017: vlink 0.16.
  • Fixed a potential crash when linking with empty object files, while using a linker script.
  • (ados/ehf): Support blink/slink linker symbols _RESLEN, _RESBASE, _NEWDATAL for generating resident (pure) programs.
  • (ados/ehf): Fixed SAS/C-compatibility linker symbol __BSSLEN. Now it represents the number of long words instead of the number of bytes. WARNING! Make sure to check your code, if you used __BSSLEN before!
  • (ados/ehf): AmigaOS LoadSeg() (up to V40) has a problem with allocating data-bss sections, which have an initialized size of 0. Implemented a workaround for this case.
  • (elf) Fixed crash in dynamic linking due to section-trimming.
  • (elf,aout) Malformatted library archive files are no longer fatal, but will be ignored.
  • (rawseg) Do not write output sections marked with NOLOAD.


06-Feb-2017: vlink 0.15d.
  • Section-trimming, introduced with V0.15b, did not work well with ELF executables. Fixed that.
  • New options -gc-all and -gc-empty for section garbage-collection.
  • New option -Z to prevent the linker from automatically removing a section's trailing zero-bytes.
  • New output format: jagsrv. Absolute raw binary output, similar to rawbin1, but with a header to make it load and execute via the Atari Jaguar SkunkBoard or the VirtualJaguar emulator.
  • (ados/ehf): Fixed a memory leak in relocation output and optimized it.
  • (elf) Allow N_FUN stabs without a relocatable label in n_value.


01-Nov-2016: vlink 0.15c.
  • Fixed problems with relocation addend sign-extension, introduced in the last version.


17-Sep-2016: vlink 0.15b.
  • Reworked reading and writing of relocations. Support more complex relocations.
  • Fixed inserting little-endian relocations, which only worked before when the reloc-fields started and ended on byte-boundaries.
  • Do not include zero-bytes at the end of a section into the ininitalized file size, for those file format which support that.
  • (elf) Fixed illegal memory access when linking an ELF program without a linker script.
  • (elf32jag) Fixed MOVEI-relocation.
  • (vobj) For little-endian the bit position in a byte of a reloc-field is now counted from right to left. VOBJ files by vasm-versions older than V1.7f may be incompatible for complex little-endian relocations (e.g. ARM).


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

$Id: index.php,v 1.13 2017/04/12 10:59:34 frank Exp $