mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
[yaml2obj][ELF] Don't explicitly set Binding with STB_*
Instead, just have 3 sub-lists, one for each of
{STB_LOCAL,STB_GLOBAL,STB_WEAK}.
This allows us to be a lot more explicit w.r.t. the symbol ordering in
the object file, because if we allowed explicitly setting the STB_*
`Binding` key for the symbol, then we might have ended up having to
shuffle STB_LOCAL symbols to the front of the list, which is likely to
cause confusion and potential for error.
Also, this new approach is simpler ;)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184506 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+7
-10
@@ -278,15 +278,6 @@ void ScalarBitSetTraits<ELFYAML::ELF_SHF>::bitset(IO &IO,
|
||||
#undef BCase
|
||||
}
|
||||
|
||||
void ScalarEnumerationTraits<ELFYAML::ELF_STB>::enumeration(
|
||||
IO &IO, ELFYAML::ELF_STB &Value) {
|
||||
#define ECase(X) IO.enumCase(Value, #X, ELF::X);
|
||||
ECase(STB_LOCAL)
|
||||
ECase(STB_GLOBAL)
|
||||
ECase(STB_WEAK)
|
||||
#undef ECase
|
||||
}
|
||||
|
||||
void ScalarEnumerationTraits<ELFYAML::ELF_STT>::enumeration(
|
||||
IO &IO, ELFYAML::ELF_STT &Value) {
|
||||
#define ECase(X) IO.enumCase(Value, #X, ELF::X);
|
||||
@@ -313,13 +304,19 @@ void MappingTraits<ELFYAML::FileHeader>::mapping(IO &IO,
|
||||
|
||||
void MappingTraits<ELFYAML::Symbol>::mapping(IO &IO, ELFYAML::Symbol &Symbol) {
|
||||
IO.mapOptional("Name", Symbol.Name, StringRef());
|
||||
IO.mapOptional("Binding", Symbol.Binding, ELFYAML::ELF_STB(0));
|
||||
IO.mapOptional("Type", Symbol.Type, ELFYAML::ELF_STT(0));
|
||||
IO.mapOptional("Section", Symbol.Section, StringRef());
|
||||
IO.mapOptional("Value", Symbol.Value, Hex64(0));
|
||||
IO.mapOptional("Size", Symbol.Size, Hex64(0));
|
||||
}
|
||||
|
||||
void MappingTraits<ELFYAML::LocalGlobalWeakSymbols>::mapping(
|
||||
IO &IO, ELFYAML::LocalGlobalWeakSymbols &Symbols) {
|
||||
IO.mapOptional("Local", Symbols.Local);
|
||||
IO.mapOptional("Global", Symbols.Global);
|
||||
IO.mapOptional("Weak", Symbols.Weak);
|
||||
}
|
||||
|
||||
void MappingTraits<ELFYAML::Section>::mapping(IO &IO,
|
||||
ELFYAML::Section &Section) {
|
||||
IO.mapOptional("Name", Section.Name, StringRef());
|
||||
|
||||
Reference in New Issue
Block a user