mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
[ELFYAML] Fix handling SHT_NOBITS sections by obj2yaml/yaml2obj tools
SHT_NOBITS sections do not have content in an object file. Now yaml2obj tool does not accept `Content` field for such sections, and obj2yaml tool does not attempt to read the section content from a file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241350 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -85,7 +85,13 @@ struct SectionOrType {
|
||||
};
|
||||
|
||||
struct Section {
|
||||
enum class SectionKind { Group, RawContent, Relocation, MipsABIFlags };
|
||||
enum class SectionKind {
|
||||
Group,
|
||||
RawContent,
|
||||
Relocation,
|
||||
NoBits,
|
||||
MipsABIFlags
|
||||
};
|
||||
SectionKind Kind;
|
||||
StringRef Name;
|
||||
ELF_SHT Type;
|
||||
@@ -106,6 +112,14 @@ struct RawContentSection : Section {
|
||||
}
|
||||
};
|
||||
|
||||
struct NoBitsSection : Section {
|
||||
llvm::yaml::Hex64 Size;
|
||||
NoBitsSection() : Section(SectionKind::NoBits) {}
|
||||
static bool classof(const Section *S) {
|
||||
return S->Kind == SectionKind::NoBits;
|
||||
}
|
||||
};
|
||||
|
||||
struct Group : Section {
|
||||
// Members of a group contain a flag and a list of section indices
|
||||
// that are part of the group.
|
||||
|
Reference in New Issue
Block a user