public class BasicProgbitsSectionImpl extends BasicElementImpl implements ObjectFile.ProgbitsSectionImpl
Constructor and Description |
---|
BasicProgbitsSectionImpl()
Create a new BasicProgbitsSectionImpl not associated with a section.
|
BasicProgbitsSectionImpl(byte[] content) |
BasicProgbitsSectionImpl(byte[] content,
ObjectFile.Section s) |
BasicProgbitsSectionImpl(ObjectFile.Section s) |
Modifier and Type | Method and Description |
---|---|
int |
getAlignment() |
byte[] |
getContent() |
Set<BuildDependency> |
getDependencies(Map<ObjectFile.Element,LayoutDecisionMap> decisions)
Implementing this method allows to declare dependencies to other Sections (i.e.
|
ObjectFile.Section |
getElement() |
List<ObjectFile.Section> |
getElements() |
int |
getMemSize(Map<ObjectFile.Element,LayoutDecisionMap> alreadyDecided)
Implement this method to provide the section size in memory (at runtime).
|
ObjectFile.Element |
getOrCreateRelocationElement(boolean useImplicitAddend)
Force the creation of a relocation section/element for this section, and return it.
|
byte[] |
getOrDecideContent(Map<ObjectFile.Element,LayoutDecisionMap> alreadyDecided,
byte[] contentHint)
Implement this method to deliver the content of the section.
|
int |
getOrDecideSize(Map<ObjectFile.Element,LayoutDecisionMap> alreadyDecided,
int sizeHint)
Implement this method to provide the size of this section.
|
boolean |
isLoadable()
Whether this section is loaded into memory at runtime.
|
ObjectFile.RelocationRecord |
markRelocationSite(int offset,
ByteBuffer bb,
ObjectFile.RelocationKind k,
String symbolName,
boolean useImplicitAddend,
Long explicitAddend)
Record (in a format-specific way) that data at the given offset in the file, for the
given number of bytes, should be fixed up according to the value of the given symbol and
the given kind of relocation.
|
ObjectFile.RelocationRecord |
markRelocationSite(int offset,
ObjectFile.RelocationKind k,
String symbolName,
boolean useImplicitAddend,
Long explicitAddend)
This is like
ObjectFile.RelocatableSectionImpl.markRelocationSite(int, java.nio.ByteBuffer, com.oracle.objectfile.ObjectFile.RelocationKind, java.lang.String, boolean, java.lang.Long) , but doesn't need to be
passed a buffer. |
void |
setContent(byte[] c) |
getDecisions, getOrDecideOffset, getOrDecideVaddr, getOwner, isReferenceable, setElement
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDecisions, getOrDecideOffset, getOrDecideVaddr, isReferenceable, setElement
public BasicProgbitsSectionImpl(byte[] content)
public BasicProgbitsSectionImpl(ObjectFile.Section s)
public BasicProgbitsSectionImpl(byte[] content, ObjectFile.Section s)
public BasicProgbitsSectionImpl()
public Set<BuildDependency> getDependencies(Map<ObjectFile.Element,LayoutDecisionMap> decisions)
ElementImpl
getDependencies
in interface ElementImpl
getDependencies
in class BasicElementImpl
public int getOrDecideSize(Map<ObjectFile.Element,LayoutDecisionMap> alreadyDecided, int sizeHint)
ElementImpl
getOrDecideSize
in interface ElementImpl
getOrDecideSize
in class BasicElementImpl
public byte[] getOrDecideContent(Map<ObjectFile.Element,LayoutDecisionMap> alreadyDecided, byte[] contentHint)
ElementImpl
getOrDecideContent
in interface ElementImpl
public int getMemSize(Map<ObjectFile.Element,LayoutDecisionMap> alreadyDecided)
ElementImpl
getMemSize
in interface ElementImpl
getMemSize
in class BasicElementImpl
public int getAlignment()
getAlignment
in interface ElementImpl
getAlignment
in class BasicElementImpl
public void setContent(byte[] c)
setContent
in interface ObjectFile.ProgbitsSectionImpl
public byte[] getContent()
getContent
in interface ObjectFile.ProgbitsSectionImpl
public ObjectFile.Section getElement()
getElement
in interface ElementImpl
getElement
in class BasicElementImpl
public List<ObjectFile.Section> getElements()
public ObjectFile.RelocationRecord markRelocationSite(int offset, ObjectFile.RelocationKind k, String symbolName, boolean useImplicitAddend, Long explicitAddend)
ObjectFile.ProgbitsSectionImpl
ObjectFile.RelocatableSectionImpl.markRelocationSite(int, java.nio.ByteBuffer, com.oracle.objectfile.ObjectFile.RelocationKind, java.lang.String, boolean, java.lang.Long)
, but doesn't need to be
passed a buffer. It uses the byte array accessed by ObjectFile.ProgbitsSectionImpl.getContent()
and
ObjectFile.ProgbitsSectionImpl.setContent(byte[])
.markRelocationSite
in interface ObjectFile.ProgbitsSectionImpl
public final ObjectFile.RelocationRecord markRelocationSite(int offset, ByteBuffer bb, ObjectFile.RelocationKind k, String symbolName, boolean useImplicitAddend, Long explicitAddend)
ObjectFile.RelocatableSectionImpl
markRelocationSite
in interface ObjectFile.RelocatableSectionImpl
offset
- the offset into the section contents of the beginning of the fixed-up bytesbb
- the byte buffer representing the encoded section contents, at least as far as
offset + length bytesk
- the kind of fixup to be appliedsymbolName
- the name of the symbol whose value is used to compute the fixed-up
bytesuseImplicitAddend
- whether the current bytes are to be used as an addendexplicitAddend
- a full-width addend, or null if useImplicitAddend is truepublic ObjectFile.Element getOrCreateRelocationElement(boolean useImplicitAddend)
ObjectFile.RelocatableSectionImpl
getOrCreateRelocationElement
in interface ObjectFile.RelocatableSectionImpl
useImplicitAddend
- whether the relocation section of interest is for implicit
addendspublic boolean isLoadable()
ElementImpl
isLoadable
in interface ElementImpl