From 1cd421ef5ea0d3601b575024ff8cac4bd0df6e79 Mon Sep 17 00:00:00 2001 From: Wouter van Kesteren Date: Thu, 5 Jan 2023 00:35:13 +0100 Subject: [PATCH] Stop crashing on RELR sections. I just added the new constants to the file and it works for my use case. I have no idea if this is enough or even correct though... Please see https://maskray.me/blog/2021-10-31-relative-relocations-and-relr --- lib/elf/dynamic.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/elf/dynamic.rb b/lib/elf/dynamic.rb index 02315e9..8cc5546 100644 --- a/lib/elf/dynamic.rb +++ b/lib/elf/dynamic.rb @@ -79,6 +79,10 @@ def initialize(val, params) 30 => [ :Flags, "FLAGS", :Value ], 32 => [ :PreinitArray, "PREINIT_ARRAY", :Address ], 33 => [ :PreinitArraySz, "PREINIT_ARRAYSZ", :Value ], + 34 => [ :SymTab_SHNDX, "SYMTAB_SHNDX", :Ignore ], + 35 => [ :RelrSz, "RELRSZ", :Value ], + 36 => [ :Relr, "RELR", :Address ], + 37 => [ :RelrEnt, "RELRENT", :Value ], # DT_VAL* constants mapping 0x6ffffdf5 => [ :GNUPrelinked, "GNU_PRELINKED", :Value ],