src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocTable.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/elf/ElfRelocTable.java

src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocTable.java

Print this page

        

*** 23,74 **** package jdk.tools.jaotc.binformat.elf; import java.util.ArrayList; import java.nio.ByteBuffer; - import java.nio.ByteOrder; import jdk.tools.jaotc.binformat.elf.ElfRelocEntry; - import jdk.tools.jaotc.binformat.elf.ElfTargetInfo; import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela; - import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Ehdr; import jdk.tools.jaotc.binformat.elf.ElfByteBuffer; ! public class ElfRelocTable { ! ArrayList<ArrayList<ElfRelocEntry>> relocEntries; ! public ElfRelocTable(int numsects) { ! relocEntries = new ArrayList<ArrayList<ElfRelocEntry>>(numsects); ! for (int i = 0; i < numsects; i++) relocEntries.add(new ArrayList<ElfRelocEntry>()); } ! public void createRelocationEntry(int sectindex, ! int offset, ! int symno, ! int type, ! int addend) { ! ! ElfRelocEntry entry = new ElfRelocEntry(offset, ! symno, ! type, ! addend); relocEntries.get(sectindex).add(entry); } ! public int getNumRelocs(int section_index) { return relocEntries.get(section_index).size(); } // Return the relocation entries for a single section // or null if no entries added to section ! public byte [] getRelocData(int section_index) { ArrayList<ElfRelocEntry> entryList = relocEntries.get(section_index); ! if (entryList.size() == 0) return null; ! ByteBuffer relocData = ElfByteBuffer.allocate(entryList.size() * Elf64_Rela.totalsize); // Copy each entry to a single ByteBuffer for (int i = 0; i < entryList.size(); i++) { ElfRelocEntry entry = entryList.get(i); --- 23,64 ---- package jdk.tools.jaotc.binformat.elf; import java.util.ArrayList; import java.nio.ByteBuffer; import jdk.tools.jaotc.binformat.elf.ElfRelocEntry; import jdk.tools.jaotc.binformat.elf.Elf.Elf64_Rela; import jdk.tools.jaotc.binformat.elf.ElfByteBuffer; ! final class ElfRelocTable { ! private final ArrayList<ArrayList<ElfRelocEntry>> relocEntries; ! ElfRelocTable(int numsects) { ! relocEntries = new ArrayList<>(numsects); ! for (int i = 0; i < numsects; i++) { relocEntries.add(new ArrayList<ElfRelocEntry>()); } + } ! void createRelocationEntry(int sectindex, int offset, int symno, int type, int addend) { ! ElfRelocEntry entry = new ElfRelocEntry(offset, symno, type, addend); relocEntries.get(sectindex).add(entry); } ! int getNumRelocs(int section_index) { return relocEntries.get(section_index).size(); } // Return the relocation entries for a single section // or null if no entries added to section ! byte[] getRelocData(int section_index) { ArrayList<ElfRelocEntry> entryList = relocEntries.get(section_index); ! if (entryList.size() == 0) { return null; ! } ByteBuffer relocData = ElfByteBuffer.allocate(entryList.size() * Elf64_Rela.totalsize); // Copy each entry to a single ByteBuffer for (int i = 0; i < entryList.size(); i++) { ElfRelocEntry entry = entryList.get(i);
*** 76,81 **** } return (relocData.array()); } } - --- 66,70 ----
src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/ElfRelocTable.java
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File