From 20e63410000ddab841584a9e41877bf561b63633 Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Sat, 28 Mar 2020 20:15:06 +0100 Subject: [PATCH] ld: ld_internal.hrl: new, define types for ld_input:input/2 and ld_phase1:phase1/1 --- erlang/apps/ld/src/ld_internal.hrl | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 erlang/apps/ld/src/ld_internal.hrl diff --git a/erlang/apps/ld/src/ld_internal.hrl b/erlang/apps/ld/src/ld_internal.hrl new file mode 100644 index 0000000..7f3ce2d --- /dev/null +++ b/erlang/apps/ld/src/ld_internal.hrl @@ -0,0 +1,47 @@ +%%% -*- erlang-indent-level: 2 -*- +%%% +%%% internal declarations for pdp10-elf ld. +%%% Copyright (C) 2020 Mikael Pettersson +%%% +%%% This file is part of pdp10-tools. +%%% +%%% pdp10-tools is free software: you can redistribute it and/or modify +%%% it under the terms of the GNU General Public License as published by +%%% the Free Software Foundation, either version 3 of the License, or +%%% (at your option) any later version. +%%% +%%% pdp10-tools is distributed in the hope that it will be useful, +%%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%%% GNU General Public License for more details. +%%% +%%% You should have received a copy of the GNU General Public License +%%% along with pdp10-tools. If not, see . + +-ifndef(LD_INTERNAL_HRL). +-define(LD_INTERNAL_HRL, 1). + +-include_lib("lib/include/pdp10_elf36.hrl"). + +-record(input, + { file :: string() + , shtab :: [#elf36_Shdr{}] + , symtab :: [#elf36_Sym{}] + , stshndx :: non_neg_integer() + }). + +-record(sectfrag, + { file :: string() + , shdr :: #elf36_Shdr{} + , relocs :: #elf36_Shdr{} | false + }). + +-record(section, + { shdr :: #elf36_Shdr{} + , frags :: [#sectfrag{}] + }). + +-type filemap() :: #{Section :: string() => Offset :: non_neg_integer()}. +-type sectionsmap() :: #{File :: string() => FileMap :: filemap()}. + +-endif. % LD_INTERNAL_HRL