src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOHeader.java
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File hotspot Cdiff src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOHeader.java

src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOHeader.java

Print this page

        

*** 22,60 **** */ package jdk.tools.jaotc.binformat.macho; import java.nio.ByteBuffer; - import java.nio.ByteOrder; - import jdk.tools.jaotc.binformat.macho.MachO; import jdk.tools.jaotc.binformat.macho.MachO.mach_header_64; import jdk.tools.jaotc.binformat.macho.MachOTargetInfo; import jdk.tools.jaotc.binformat.macho.MachOByteBuffer; ! public class MachOHeader { ! ByteBuffer header; ! public MachOHeader() { header = MachOByteBuffer.allocate(mach_header_64.totalsize); header.putInt(mach_header_64.magic.off, mach_header_64.MH_MAGIC_64); header.putInt(mach_header_64.cputype.off, MachOTargetInfo.getMachOArch()); header.putInt(mach_header_64.cpusubtype.off, MachOTargetInfo.getMachOSubArch()); header.putInt(mach_header_64.flags.off, 0x2000); header.putInt(mach_header_64.filetype.off, mach_header_64.MH_OBJECT); } ! public void setCmdSizes(int ncmds, int sizeofcmds) { header.putInt(mach_header_64.ncmds.off, ncmds); header.putInt(mach_header_64.sizeofcmds.off, sizeofcmds); } ! public int getCmdSize() { return (header.getInt(mach_header_64.sizeofcmds.off)); } ! public byte[] getArray() { return header.array(); } } - --- 22,57 ---- */ package jdk.tools.jaotc.binformat.macho; import java.nio.ByteBuffer; import jdk.tools.jaotc.binformat.macho.MachO.mach_header_64; import jdk.tools.jaotc.binformat.macho.MachOTargetInfo; import jdk.tools.jaotc.binformat.macho.MachOByteBuffer; ! final class MachOHeader { ! private final ByteBuffer header; ! MachOHeader() { header = MachOByteBuffer.allocate(mach_header_64.totalsize); header.putInt(mach_header_64.magic.off, mach_header_64.MH_MAGIC_64); header.putInt(mach_header_64.cputype.off, MachOTargetInfo.getMachOArch()); header.putInt(mach_header_64.cpusubtype.off, MachOTargetInfo.getMachOSubArch()); header.putInt(mach_header_64.flags.off, 0x2000); header.putInt(mach_header_64.filetype.off, mach_header_64.MH_OBJECT); } ! void setCmdSizes(int ncmds, int sizeofcmds) { header.putInt(mach_header_64.ncmds.off, ncmds); header.putInt(mach_header_64.sizeofcmds.off, sizeofcmds); } ! int getCmdSize() { return (header.getInt(mach_header_64.sizeofcmds.off)); } ! byte[] getArray() { return header.array(); } }
src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/macho/MachOHeader.java
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File