From 77d7658247e2c8a8759e25c3bf888208fca18c3d Mon Sep 17 00:00:00 2001 From: Mikael Pettersson Date: Sun, 10 Aug 2025 22:28:47 +0200 Subject: [PATCH] rename pdp10_elf36.hrl to libelf.hrl --- erlang/apps/ar/src/ar.erl | 4 ++-- erlang/apps/as/src/assemble.erl | 4 ++-- erlang/apps/as/src/input.erl | 4 ++-- erlang/apps/as/src/output.erl | 2 +- erlang/apps/as/src/parse.erl | 4 ++-- erlang/apps/elf2boot/src/elf2boot.erl | 2 +- erlang/apps/ld/src/ld_internal.hrl | 2 +- .../lib/include/{pdp10_elf36.hrl => libelf.hrl} | 16 +++++++++------- erlang/apps/lib/src/archive.erl | 2 +- erlang/apps/lib/src/pdp10_elf36.erl | 2 +- erlang/apps/nm/src/nm.erl | 2 +- erlang/apps/readelf/src/readelf.erl | 2 +- erlang/apps/sim/src/sim_loader.erl | 2 +- 13 files changed, 25 insertions(+), 23 deletions(-) rename erlang/apps/lib/include/{pdp10_elf36.hrl => libelf.hrl} (99%) diff --git a/erlang/apps/ar/src/ar.erl b/erlang/apps/ar/src/ar.erl index 5b9588e..56046f6 100644 --- a/erlang/apps/ar/src/ar.erl +++ b/erlang/apps/ar/src/ar.erl @@ -1,7 +1,7 @@ %%% -*- erlang-indent-level: 2 -*- %%% %%% 'ar' and 'ranlib' for pdp10-elf -%%% Copyright (C) 2013-2023 Mikael Pettersson +%%% Copyright (C) 2013-2025 Mikael Pettersson %%% %%% This file is part of pdp10-tools. %%% @@ -24,7 +24,7 @@ -include_lib("kernel/include/file.hrl"). -include_lib("lib/include/pdp10_ar.hrl"). -include_lib("lib/include/archive.hrl"). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -record(options, { operation :: $d | $q | $r | $s | $t | $x | print_armap diff --git a/erlang/apps/as/src/assemble.erl b/erlang/apps/as/src/assemble.erl index 1678ca7..4f548c5 100644 --- a/erlang/apps/as/src/assemble.erl +++ b/erlang/apps/as/src/assemble.erl @@ -1,7 +1,7 @@ %%% -*- erlang-indent-level: 2 -*- %%% %%% sections assembler for pdp10-elf as -%%% Copyright (C) 2013-2023 Mikael Pettersson +%%% Copyright (C) 2013-2025 Mikael Pettersson %%% %%% This file is part of pdp10-tools. %%% @@ -25,7 +25,7 @@ ]). -include("tunit.hrl"). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -spec tunit(#tunit{}) -> {ok, #tunit{}} | {error, {module(), term()}}. tunit(Tunit) -> diff --git a/erlang/apps/as/src/input.erl b/erlang/apps/as/src/input.erl index 9ee6e9d..4786e52 100644 --- a/erlang/apps/as/src/input.erl +++ b/erlang/apps/as/src/input.erl @@ -1,7 +1,7 @@ %%% -*- erlang-indent-level: 2 -*- %%% %%% input processing phase for pdp10-elf as -%%% Copyright (C) 2013-2023 Mikael Pettersson +%%% Copyright (C) 2013-2025 Mikael Pettersson %%% %%% This file is part of pdp10-tools. %%% @@ -25,7 +25,7 @@ ]). -include("tunit.hrl"). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -spec files([string()]) -> {ok, #tunit{}} | {error, {module(), term()}}. files(Files0) -> diff --git a/erlang/apps/as/src/output.erl b/erlang/apps/as/src/output.erl index 51535c5..9baccd2 100644 --- a/erlang/apps/as/src/output.erl +++ b/erlang/apps/as/src/output.erl @@ -52,7 +52,7 @@ ]). -include("tunit.hrl"). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -record(strtab, { map :: #{string() => non_neg_integer()} diff --git a/erlang/apps/as/src/parse.erl b/erlang/apps/as/src/parse.erl index 00e8807..07130e5 100644 --- a/erlang/apps/as/src/parse.erl +++ b/erlang/apps/as/src/parse.erl @@ -1,7 +1,7 @@ %%% -*- erlang-indent-level: 2 -*- %%% %%% parser for pdp10-elf as -%%% Copyright (C) 2013-2023 Mikael Pettersson +%%% Copyright (C) 2013-2025 Mikael Pettersson %%% %%% This file is part of pdp10-tools. %%% @@ -27,7 +27,7 @@ -include("token.hrl"). -include("tunit.hrl"). -include_lib("lib/include/pdp10_opcodes.hrl"). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -type location() :: scan:location(). diff --git a/erlang/apps/elf2boot/src/elf2boot.erl b/erlang/apps/elf2boot/src/elf2boot.erl index 9b6adb9..e0dd203 100644 --- a/erlang/apps/elf2boot/src/elf2boot.erl +++ b/erlang/apps/elf2boot/src/elf2boot.erl @@ -34,7 +34,7 @@ , format_error/1 ]). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -record(options, { verbose :: boolean() % -v/--verbose diff --git a/erlang/apps/ld/src/ld_internal.hrl b/erlang/apps/ld/src/ld_internal.hrl index c62aa85..1e1aaf9 100644 --- a/erlang/apps/ld/src/ld_internal.hrl +++ b/erlang/apps/ld/src/ld_internal.hrl @@ -21,7 +21,7 @@ -ifndef(LD_INTERNAL_HRL). -define(LD_INTERNAL_HRL, 1). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -type ifile() :: string() % explicit input .o-file | { Archive :: string() % archive name diff --git a/erlang/apps/lib/include/pdp10_elf36.hrl b/erlang/apps/lib/include/libelf.hrl similarity index 99% rename from erlang/apps/lib/include/pdp10_elf36.hrl rename to erlang/apps/lib/include/libelf.hrl index 2a19fbd..ab52a95 100644 --- a/erlang/apps/lib/include/pdp10_elf36.hrl +++ b/erlang/apps/lib/include/libelf.hrl @@ -1,6 +1,6 @@ %%% -*- erlang-indent-level: 2 -*- %%% -%%% pdp10_elf36.hrl -- ELF definitions for PDP10 +%%% libelf.hrl -- ELF definitions for Erlang %%% Copyright (C) 2013-2025 Mikael Pettersson %%% %%% This file is part of pdp10-tools. @@ -20,12 +20,14 @@ %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% -%%% This is essentially the standard Elf32 declarations with 8/16/32-bit -%%% primitive types replaced by 9/18/36-bit primitive types, and Elf32 -%%% replaced by elf36. +%%% These are the standard ELF32 and ELF64 declarations adapted for Erlang. +%%% +%%% As an extension ELF36 is defined as ELF32 where each N x 8 bit integer +%%% has been expanded to N x 9 bits, making Uchar 9 bits, Half 18 bits, and +%%% Word 32-bits. This would be appropriate for e.g. the PDP-10. --ifndef(PDP10_ELF36_HRL). --define(PDP10_ELF36_HRL, 1). +-ifndef(LIBELF_HRL). +-define(LIBELF_HRL, 1). -include("pdp10_stdint.hrl"). @@ -1728,4 +1730,4 @@ -define(AT_SUN_BRAND_AUX3, 2022). -define(AT_SUN_CAP_HW2, 2023). % Extension of AT_SUN_CAP_HW1. --endif. % PDP10_ELF36_HRL +-endif. % LIBELF_HRL diff --git a/erlang/apps/lib/src/archive.erl b/erlang/apps/lib/src/archive.erl index c7ddd4a..132c762 100644 --- a/erlang/apps/lib/src/archive.erl +++ b/erlang/apps/lib/src/archive.erl @@ -30,7 +30,7 @@ -include_lib("kernel/include/file.hrl"). -include_lib("lib/include/pdp10_ar.hrl"). -include_lib("lib/include/archive.hrl"). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -type file() :: pdp10_stdio:file(). diff --git a/erlang/apps/lib/src/pdp10_elf36.erl b/erlang/apps/lib/src/pdp10_elf36.erl index 8ead428..e01c283 100644 --- a/erlang/apps/lib/src/pdp10_elf36.erl +++ b/erlang/apps/lib/src/pdp10_elf36.erl @@ -37,7 +37,7 @@ , format_error/1 ]). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -include_lib("lib/include/pdp10_stdint.hrl"). -type read_field() :: fun((pdp10_stdio:file()) diff --git a/erlang/apps/nm/src/nm.erl b/erlang/apps/nm/src/nm.erl index b2876d4..17a9faa 100644 --- a/erlang/apps/nm/src/nm.erl +++ b/erlang/apps/nm/src/nm.erl @@ -23,7 +23,7 @@ -include_lib("lib/include/pdp10_ar.hrl"). -include_lib("lib/include/archive.hrl"). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -record(options, { print_file_name = false % -A, -o, --print-file-name diff --git a/erlang/apps/readelf/src/readelf.erl b/erlang/apps/readelf/src/readelf.erl index b165b04..a63dcdc 100644 --- a/erlang/apps/readelf/src/readelf.erl +++ b/erlang/apps/readelf/src/readelf.erl @@ -21,7 +21,7 @@ -module(readelf). -export([main/1]). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -include_lib("lib/include/pdp10_opcodes.hrl"). -record(options, diff --git a/erlang/apps/sim/src/sim_loader.erl b/erlang/apps/sim/src/sim_loader.erl index fa56f77..efd9a73 100644 --- a/erlang/apps/sim/src/sim_loader.erl +++ b/erlang/apps/sim/src/sim_loader.erl @@ -28,7 +28,7 @@ , format_error/1 ]). --include_lib("lib/include/pdp10_elf36.hrl"). +-include_lib("lib/include/libelf.hrl"). -type address() :: non_neg_integer().