package com.oracle.objectfile.macho;
import java.util.EnumSet;
import java.util.Map;
import com.oracle.objectfile.LayoutDecisionMap;
import com.oracle.objectfile.ObjectFile;
import com.oracle.objectfile.ObjectFile.Element;
import com.oracle.objectfile.ObjectFile.NobitsSectionImpl;
import com.oracle.objectfile.macho.MachOObjectFile.SectionFlag;
import com.oracle.objectfile.macho.MachOObjectFile.Segment64Command;
public class MachOZeroFillSection extends MachOUserDefinedSection implements ObjectFile.NobitsSectionImpl {
public MachOZeroFillSection(MachOObjectFile owner, String name, Segment64Command segment, NobitsSectionImpl impl) {
this(owner, name, segment, impl, EnumSet.noneOf(SectionFlag.class));
}
public MachOZeroFillSection(MachOObjectFile owner, String name, Segment64Command segment, NobitsSectionImpl impl, EnumSet<SectionFlag> flags) {
super(owner, name, 1, segment, MachOObjectFile.SectionType.ZEROFILL, impl, flags);
}
@Override
public byte[] getOrDecideContent(Map<Element, LayoutDecisionMap> alreadyDecided, byte[] contentHint) {
return new byte[0];
}
@Override
public int getOrDecideSize(Map<Element, LayoutDecisionMap> alreadyDecided, int sizeHint) {
return 0;
}
@Override
public int getMemSize(Map<Element, LayoutDecisionMap> alreadyDecided) {
return (int) getSizeInMemory();
}
@Override
public long getSizeInMemory() {
return ((NobitsSectionImpl) impl).getSizeInMemory();
}
@Override
public void setSizeInMemory(long size) {
((NobitsSectionImpl) impl).setSizeInMemory(size);
}
}