public ELFProgbitsSection(ELFObjectFile owner, String name, int alignment, ProgbitsSectionImpl impl, EnumSet<ELFSectionFlag> flags) { super(owner, name, alignment, ELFObjectFile.SectionType.PROGBITS, impl != null ? impl : new BasicProgbitsSectionImpl(new byte[0]), flags); // this *is* necessary because the newProgbitsSection helper doesn't see the impl if (impl == null) { // i.e. if *we* just created this.impl in the "? :" above this.impl.setElement(this); } }
public PECoffProgbitsSection(PECoffObjectFile owner, String name, int alignment, ProgbitsSectionImpl impl, EnumSet<PECoffSectionFlag> flags) { super(owner, name, alignment, impl != null ? impl : new BasicProgbitsSectionImpl(new byte[0]), flags); // this *is* necessary because the newProgbitsSection helper doesn't see the impl if (impl == null) { // i.e. if *we* just created this.impl in the "? :" above this.impl.setElement(this); } }
@Override public MachOUserDefinedSection newUserDefinedSection(Segment segment, String name, int alignment, ElementImpl impl) { assert segment != null; ElementImpl ourImpl; if (impl == null) { ourImpl = new BasicProgbitsSectionImpl((Section) null); } else { ourImpl = impl; } MachOUserDefinedSection userDefined = new MachOUserDefinedSection(this, name, alignment, (Segment64Command) segment, SectionType.REGULAR, ourImpl); ourImpl.setElement(userDefined); return userDefined; }
public ELFProgbitsSection(ELFObjectFile owner, String name, int alignment, EnumSet<ELFSectionFlag> flags, int shtIndex, InputDisassembler in, int size) { super(owner, name, alignment, ELFObjectFile.SectionType.PROGBITS, new BasicProgbitsSectionImpl(in.readBlob(size)), flags, shtIndex); // this *is* necessary because the newProgbitsSection helper doesn't see the impl this.impl.setElement(this); }
public PECoffProgbitsSection(PECoffObjectFile owner, String name, int alignment, EnumSet<PECoffSectionFlag> flags, int shtIndex, InputDisassembler in, int size) { super(owner, name, alignment, new BasicProgbitsSectionImpl(in.readBlob(size)), flags, shtIndex); // this *is* necessary because the newProgbitsSection helper doesn't see the impl this.impl.setElement(this); }
final ProgbitsSectionImpl roDataImpl = new BasicProgbitsSectionImpl(roDataBuffer.getBytes()); final String roDataSectionName = SectionName.RODATA.getFormatDependentName(objectFile.getFormat()); roDataSection = objectFile.newProgbitsSection(roDataSectionName, objectFile.getPageSize(), false, false, roDataImpl); final ProgbitsSectionImpl rwDataImpl = new BasicProgbitsSectionImpl(rwDataBuffer.getBytes()); final String rwDataSectionName = SectionName.DATA.getFormatDependentName(objectFile.getFormat()); rwDataSection = objectFile.newProgbitsSection(rwDataSectionName, objectFile.getPageSize(), true, false, rwDataImpl); heapSectionImpl = new BasicProgbitsSectionImpl(heapSectionBuffer.getBytes()); final String heapSectionName = SectionName.SVM_HEAP.getFormatDependentName(objectFile.getFormat()); heapSection = objectFile.newProgbitsSection(heapSectionName, objectFile.getPageSize(), writable, false, heapSectionImpl);