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

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

Print this page

        

*** 67,84 **** --- 67,86 ---- private ElfSection createByteSection(ArrayList<ElfSection>sections, String sectName, byte [] scnData, boolean hasRelocs, + int align, int scnFlags, int scnType) { ElfSection sect = new ElfSection(sectName, scnData, scnFlags, scnType, hasRelocs, + align, sections.size()); // Add this section to our list sections.add(sect); return (sect);
*** 89,99 **** ElfSection sect; boolean hasRelocs = c.hasRelocations(); byte[] scnData = c.getByteArray(); int scnType = Elf64_Shdr.SHT_PROGBITS; ! boolean zeros = hasRelocs; if (zeros) { for (byte b : scnData) { if (b != 0) { zeros = false; break; --- 91,101 ---- ElfSection sect; boolean hasRelocs = c.hasRelocations(); byte[] scnData = c.getByteArray(); int scnType = Elf64_Shdr.SHT_PROGBITS; ! boolean zeros = !hasRelocs; if (zeros) { for (byte b : scnData) { if (b != 0) { zeros = false; break;
*** 103,113 **** scnType = Elf64_Shdr.SHT_NOBITS; } } sect = createByteSection(sections, c.getContainerName(), ! scnData, hasRelocs, scnFlags, scnType); c.setSectionId(sect.getSectionId()); } private void createCodeSection(ArrayList<ElfSection>sections, CodeContainer c) { --- 105,115 ---- scnType = Elf64_Shdr.SHT_NOBITS; } } sect = createByteSection(sections, c.getContainerName(), ! scnData, hasRelocs, segmentSize, scnFlags, scnType); c.setSectionId(sect.getSectionId()); } private void createCodeSection(ArrayList<ElfSection>sections, CodeContainer c) {
*** 134,144 **** ElfHeader eh = new ElfHeader(); ArrayList<ElfSection> sections = new ArrayList<ElfSection>(); // Create the null section ! createByteSection(sections, null, null, false, 0, 0); // Create text section createCodeSection(sections, binContainer.getCodeContainer()); createReadOnlySection(sections, binContainer.getMetaspaceNamesContainer()); createReadOnlySection(sections, binContainer.getKlassesOffsetsContainer()); --- 136,146 ---- ElfHeader eh = new ElfHeader(); ArrayList<ElfSection> sections = new ArrayList<ElfSection>(); // Create the null section ! createByteSection(sections, null, null, false, 1, 0, 0); // Create text section createCodeSection(sections, binContainer.getCodeContainer()); createReadOnlySection(sections, binContainer.getMetaspaceNamesContainer()); createReadOnlySection(sections, binContainer.getKlassesOffsetsContainer());
*** 168,177 **** --- 170,180 ---- // strtab in sh_link field ElfSection strTabSection = createByteSection(sections, ".strtab", symtab.getStrtabArray(), false, + 1, 0, Elf64_Shdr.SHT_STRTAB); // Now create .symtab section with the symtab data constructed. // On Linux, sh_link of symtab contains the index of string table
*** 179,188 **** --- 182,192 ---- // non-local symbol ElfSection symTabSection = createByteSection(sections, ".symtab", symtab.getSymtabArray(), false, + 8, 0, Elf64_Shdr.SHT_SYMTAB); symTabSection.setLink(strTabSection.getSectionId()); symTabSection.setInfo(symtab.getNumLocalSyms());
*** 194,203 **** --- 198,208 ---- // Now, finally, after creating all sections, create shstrtab section ElfSection shStrTabSection = createByteSection(sections, ".shstrtab", null, false, + 1, 0, Elf64_Shdr.SHT_STRTAB); eh.setSectionStrNdx(shStrTabSection.getSectionId()); // Update all section offsets and the Elf header section offset
*** 436,445 **** --- 441,451 ---- String relname = ".rela" + sect.getName(); ElfSection relocSection = createByteSection(sections, relname, elfRelocTable.getRelocData(i), false, + 8, 0, Elf64_Shdr.SHT_RELA); relocSection.setLink(symtabsectidx); relocSection.setInfo(sect.getSectionId()); }
src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/elf/JELFRelocObject.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File