aboutsummaryrefslogtreecommitdiffstats
path: root/make/elf-header.cfg
diff options
context:
space:
mode:
Diffstat (limited to 'make/elf-header.cfg')
-rw-r--r--make/elf-header.cfg56
1 files changed, 55 insertions, 1 deletions
diff --git a/make/elf-header.cfg b/make/elf-header.cfg
index 05c7d79..53da3f6 100644
--- a/make/elf-header.cfg
+++ b/make/elf-header.cfg
@@ -6,7 +6,61 @@ HierarchicalNativeOutput false
#Implements Sym32 Sym
#Implements Sym64 Sym
-EmitStruct Ehdr
+# ELF-1 (part-1) is independent of CPUType/ABI
+# hence can use an arbitrary MachineDescriptor index
+# for reading the struct Ehdr_p1 !
+StructMachineDescriptorIndex Ehdr_p1 private static final int mdIdx = 0;
+
+# The following sub structures shall use an mdIdx
+# defined by ELF-1 header code, set w/ ctor!
+StructMachineDescriptorIndex Ehdr_p2 private final int mdIdx;
+StructMachineDescriptorIndex Shdr private final int mdIdx;
+
+ManuallyImplement Ehdr_p2.size
+ManuallyImplement Ehdr_p2.create
+ManuallyImplement Ehdr_p2.Ehdr_p2
+ManuallyImplement Shdr.size
+ManuallyImplement Shdr.create
+ManuallyImplement Shdr.Shdr
+
+CustomJavaCode Ehdr_p2 public static int size(final int mdIdx) {
+CustomJavaCode Ehdr_p2 return Ehdr_p2_size[mdIdx];
+CustomJavaCode Ehdr_p2 }
+CustomJavaCode Ehdr_p2
+CustomJavaCode Ehdr_p2 public static Ehdr_p2 create(final int mdIdx) {
+CustomJavaCode Ehdr_p2 return create(mdIdx, Buffers.newDirectByteBuffer(size(mdIdx)));
+CustomJavaCode Ehdr_p2 }
+CustomJavaCode Ehdr_p2
+CustomJavaCode Ehdr_p2 public static Ehdr_p2 create(final int mdIdx, final java.nio.ByteBuffer buf) {
+CustomJavaCode Ehdr_p2 return new Ehdr_p2(mdIdx, buf);
+CustomJavaCode Ehdr_p2 }
+CustomJavaCode Ehdr_p2
+CustomJavaCode Ehdr_p2 Ehdr_p2(final int mdIdx, final java.nio.ByteBuffer buf) {
+CustomJavaCode Ehdr_p2 this.mdIdx = mdIdx;
+CustomJavaCode Ehdr_p2 this.md = MachineDescription.StaticConfig.values()[mdIdx].md;
+CustomJavaCode Ehdr_p2 this.accessor = new StructAccessor(buf);
+CustomJavaCode Ehdr_p2 }
+
+CustomJavaCode Shdr public static int size(final int mdIdx) {
+CustomJavaCode Shdr return Shdr_size[mdIdx];
+CustomJavaCode Shdr }
+CustomJavaCode Shdr
+CustomJavaCode Shdr public static Shdr create(final int mdIdx) {
+CustomJavaCode Shdr return create(mdIdx, Buffers.newDirectByteBuffer(size(mdIdx)));
+CustomJavaCode Shdr }
+CustomJavaCode Shdr
+CustomJavaCode Shdr public static Shdr create(final int mdIdx, final java.nio.ByteBuffer buf) {
+CustomJavaCode Shdr return new Shdr(mdIdx, buf);
+CustomJavaCode Shdr }
+CustomJavaCode Shdr
+CustomJavaCode Shdr Shdr(final int mdIdx, final java.nio.ByteBuffer buf) {
+CustomJavaCode Shdr this.mdIdx = mdIdx;
+CustomJavaCode Shdr this.md = MachineDescription.StaticConfig.values()[mdIdx].md;
+CustomJavaCode Shdr this.accessor = new StructAccessor(buf);
+CustomJavaCode Shdr }
+
+EmitStruct Ehdr_p1
+EmitStruct Ehdr_p2
EmitStruct Shdr
#EmitStruct Sym32
#EmitStruct Sym64