From 5fd3508bd3c45ed83757b47caa7a24361bec71cb Mon Sep 17 00:00:00 2001 From: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Date: Tue, 25 Mar 2025 18:44:41 +0100 Subject: Call Simple function from C (#179) * Call simple function from c * Small fix * Use different test values --- chapter21/src/main/java/com/seaofnodes/simple/codegen/ElfFile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'chapter21/src/main/java') diff --git a/chapter21/src/main/java/com/seaofnodes/simple/codegen/ElfFile.java b/chapter21/src/main/java/com/seaofnodes/simple/codegen/ElfFile.java index 5bf83542..6c8a1fc1 100644 --- a/chapter21/src/main/java/com/seaofnodes/simple/codegen/ElfFile.java +++ b/chapter21/src/main/java/com/seaofnodes/simple/codegen/ElfFile.java @@ -283,7 +283,7 @@ public class ElfFile { // populate function symbols encodeFunctions(symbols, text); // populate big constants - encodeConstants(symbols, rdata); + // encodeConstants(symbols, rdata); // create .text relocations DataSection text_rela = new DataSection(".rela.text", 4 /* SHT_RELA */); @@ -301,7 +301,7 @@ public class ElfFile { write8(text_rela._contents, -4); } // relocations to constants - for (Map.Entry e : _code._encoding._bigCons.entrySet()) { + if (false) for (Map.Entry e : _code._encoding._bigCons.entrySet()) { int nid = e.getKey()._nid; int sym_id = _bigCons.get(e.getValue())._index; int offset = _code._encoding._opStart[nid] + _code._encoding._opLen[nid] - 4; -- cgit v1.2.3