{"id":20375956,"url":"https://github.com/nzeemin/pclink11","last_synced_at":"2025-04-12T07:35:56.951Z","repository":{"id":92024048,"uuid":"159327574","full_name":"nzeemin/pclink11","owner":"nzeemin","description":"Cross-linker, porting PDP-11 LINK to C/C++, WIP 🚧","archived":false,"fork":false,"pushed_at":"2025-03-17T18:43:24.000Z","size":1551,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-26T02:51:08.083Z","etag":null,"topics":["cplusplus","cross-link","linker","pdp-11","pdp11","retrocomputing"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nzeemin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-27T11:51:29.000Z","updated_at":"2025-03-04T21:10:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"b8ecc0dd-d971-4e06-9025-27933c292679","html_url":"https://github.com/nzeemin/pclink11","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzeemin%2Fpclink11","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzeemin%2Fpclink11/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzeemin%2Fpclink11/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nzeemin%2Fpclink11/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nzeemin","download_url":"https://codeload.github.com/nzeemin/pclink11/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248535346,"owners_count":21120540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cross-link","linker","pdp-11","pdp11","retrocomputing"],"created_at":"2024-11-15T01:34:18.773Z","updated_at":"2025-04-12T07:35:56.938Z","avatar_url":"https://github.com/nzeemin.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pclink11\r\n[![License: LGPL v3](https://img.shields.io/badge/License-LGPL%20v3-blue.svg)](https://www.gnu.org/licenses/lgpl-3.0)\r\n[![Build status](https://ci.appveyor.com/api/projects/status/3lt4c9rxx2bv0g0g?svg=true)](https://ci.appveyor.com/project/nzeemin/pclink11)\r\n[![Build Status](https://github.com/nzeemin/pclink11/actions/workflows/push-matrix.yml/badge.svg?branch=master)](https://github.com/nzeemin/pclink11/actions/workflows/push-matrix.yml)\r\n[![CodeFactor](https://www.codefactor.io/repository/github/nzeemin/pclink11/badge)](https://www.codefactor.io/repository/github/nzeemin/pclink11)\r\n\r\nAttempt to port PDP-11 LINKer to PC C/C++ — learning how the linker works, the hard way.\r\n\r\nThe code (partially) ported from MACRO-11 sources to C/C++.\r\nPort source: RT-11 LINK V05.45.\r\n\r\n## Authors\r\n * Nikita Zimin (@nzeemin)\r\n * Vladimir Voroshilov (@voroshil)\r\n\r\n## Status: Work in Progress 🚧\r\n\r\nCurrently the PCLINK11 links most of test OBJ files properly, but we have some troubles linking tests with libraries.\r\n\r\n## Usage\r\n\r\nThe source code is able to compile under Windows (VS2013/VS2015), and also under Linux/MacOS (gcc/clang, use the Makefile).\r\n\r\nCommand line:\r\n\r\n`pclink11 \u003cinput files and options\u003e`\r\n\r\nOptions (both `/` and `-` prefixes are allowed):\r\n- `-EXECUTE:filespec` — Specifies the name of the memory image file\r\n- `-NOBITMAP` `-X` — Do not emit bit map\r\n- `-WIDE` `-W` — Produces a load map that is 132-columns wide\r\n- `-ALPHABETIZE` `-A` — Lists global symbols on the link map in alphabetical order\r\n- `-SYMBOLTABLE` `-STB` — Generates a symbol table file (.STB file)\r\n- `-MAP` — Generates map file\r\n- `-FOREGROUND` `-R` — Foreground link\r\n- `-LDA` `-L` — LDA output\r\n- `-FORLIB` `-F` — Include FORLIB.OBJ\r\n- `-T:address` — Specify transfer address\r\n- `-M:address` — Modify initial stack\r\n- `-B:address` — Specify bottom address for link\r\n- `-H:address` — Specify top address for link\r\n- `-Q:section=address` — Set section to absolute address\r\n- `--version` — Show the program version information\r\n- `--help` — Show quick help on the command line options\r\n\r\nInput files and options are space-separated.\r\n\r\nExamples:\r\n- `pclink11 HELLO.OBJ` — link the object file, will produce `HELLO.SAV` executable\r\n- `pclink11 -MAP -SYMBOLTABLE -EXECUTE:LD.SYS LD.OBJ SYSLIB.OBJ -X` — link object file with system library, produce map file and symbol file, save output as `LD.SYS`, do not put bitmap in the first block\r\n- `pclink11 TEST1.OBJ TEST2.OBJ -MAP -WIDE -A` — link two object files, generate map file with wide format, alphabetize list of symbols\r\n\r\n## Testing Strategy\r\nFolder `tests` contains more than 100 sub-folders with .OBJ files.\r\n\r\nFirst, we use [RT-11 simulator](http://emulator.pdp-11.org.ru/RT-11/distr/) written by Dmitry Patronov to produce \"etalon\" or \"original\" output files, they renamed with `-11` suffix — see `!runtest11.cmd` command file.\r\nThen, we run the `pclink11` with to produce \"our\" output files, they renamed with `-my` suffix — see `!runtestmy.cmd` command file and `testrunner` utility.\r\nAnd finally, we compare \"original\" files with \"our\" files, line-to-line or byte-to-byte, using `testanalyzer` utility.\r\n\r\n\"Our\" MAP files differs in the first line (program name, date/time, no page number), and there's no paging, so no page header lines.\r\nSAV/SYS/REL and STB files are binary, compared byte-to-byte, should be no differences.\r\nLog files are absolutely different, we're not comparing them, but in \"our\" log files we're looking for \"SUCCESS\"/\"ERROR\" and so on.\r\n\r\n## TODO\r\n\r\nFirst priority:\r\n- Fix bugs for the failing test cases\r\n\r\nSecond priority:\r\n- Need more tests, currently we have 121 test cases\r\n- Reduce amount of logging, add option for verbosity level\r\n- Process other command-line options, including file-specific ones\r\n\r\nNot implemented now, and not sure we will:\r\n- Link for foreground execution with `-R` or `-FOREGROUND` option, produce .REL file\r\n- LDA output — produce a file in absolute binary loader format (option `-L`)\r\n- Overlays\r\n- Linkage with separated instructions/data spaces\r\n\r\n## Links\r\n- [DEC-11-ZLDA-D PDP-11 LINK-11 Linker and LIBR-11 Librarian May71](https://archive.org/details/bitsavers_decpdp11do11LINK11LinkerandLIBR11LibrarianMay71_1259623)\r\n- [AA-PD6PA-TC RT–11 Volume and File Formats Manual](http://www.bitsavers.org/pdf/dec/pdp11/rt11/v5.6_Aug91/AA-PD6PA-TC_RT-11_Volume_and_File_Formats_Manual_Aug91.pdf)\r\n- [macro-11 - cross-assembler by Richard Krehbiel](https://github.com/simh/simtools/tree/master/crossassemblers/macro11)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzeemin%2Fpclink11","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnzeemin%2Fpclink11","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnzeemin%2Fpclink11/lists"}