Skip to content

Latest commit

 

History

History
executable file
·
125 lines (87 loc) · 3.29 KB

wlalink.rst

File metadata and controls

executable file
·
125 lines (87 loc) · 3.29 KB

Manpage: WLA-LINK

SYNOPSIS

wlalink [OPTIONS] LINK_FILE OUTPUT_FILE

OPTIONS

-v Display information about ROM file after a succesful linking
-s Produce NO$GMB symbol file
-S Produce WLA symbol file
-d Discard all unreferenced FREE and SEMIFREE sections
-i Write list files (Note: WLA needs -i as wel)
-L LIBDIR Look in LIBDIR for libaries before looking in CWD

Choose one:

-b OUT Program file linking
-r OUT ROM image linking

DESCRIPTION

:manpage:`wlalink(1)` is a part of WLA-DX. It links one or more object files (and perhaps some library files) together to produce a ROM image / program file.

LINK_FILE is a text file that contains information about the files you want to link together. Here's the format:

  1. You must define the group for the files. Put the name of the group inside brackets. Valid group definitions are

    [objects]
    [libraries]
    [header]
    [footer]
    [definitions]
    
  2. Start to list the file names.

    [objects]
    main.o
    vbi.o
    level_01.o
    ...
    
  3. Give parameters to the library files:

    [libraries]
    bank 0 slot 1 speed.lib
    bank 4 slot 2 map_data.lib
    ...
    

    Here you can also use base to define the 65816 CPU bank number (like .BASE works in WLA):

    [libraries]
    bank 0 slot 1 base $80 speed.lib
    bank 4 slot 2 base $80 map_data.lib
    ...
    

    You must tell WLALINK the bank and the slot for the library files.

  4. If you want to use header and/or footer in your project, you can type the following:

    [header]
    header.dat
    [footer]
    footer.dat
    
  5. If you want to make value definitions, here's your chance:

    [definitions]
    debug 1
    max_str_len 128
    start $150
    ...
    

If flag -i is given, :manpage:`wlalink(1)` will write list files. Note that you must compile the object and library files with -i flag as well. Otherwise :manpage:`wlalink(1)` has no extra information it needs to build list files.

Here is an example of a list file: Let's assume you've compiled a source file called main.s using the -i flag. After you've linked the result also with the -i flag :manpage:`wlalink(1)` has created a list file called main.lst. This file contains the source text and the result data the source compiled into. List files are good for debugging.

Make sure you don't create duplicate labels in different places in the memory map as they break the linking loop. Duplicate labels are allowed when they overlap each other in the destination machine's memory.

EXAMPLES

wlalink -r linkfile testa.sfc
wlalink -d -i -b linkfile testb.sfc
wlalink -v -S -L ../../lib linkfile testc.sfc
.. only:: man

    SEE ALSO
    --------

    :manpage:`wla-dx(7)`