[llvm] r184468 - [yaml2obj][ELF] Allow symbols to reference sections.
Michael Gottesman
mgottesman at apple.com
Fri Jun 21 13:09:24 PDT 2013
This commit or 184469 is causing buildbot failures:
http://lab.llvm.org:8013/builders/phase2%20-%20living/builds/3641
Can you fix this or revert?
Michael
On Jun 20, 2013, at 1:59 PM, Sean Silva <silvas at purdue.edu> wrote:
> Author: silvas
> Date: Thu Jun 20 15:59:41 2013
> New Revision: 184468
>
> URL: http://llvm.org/viewvc/llvm-project?rev=184468&view=rev
> Log:
> [yaml2obj][ELF] Allow symbols to reference sections.
>
> Modified:
> llvm/trunk/include/llvm/Object/ELFYAML.h
> llvm/trunk/lib/Object/ELFYAML.cpp
> llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
> llvm/trunk/tools/yaml2obj/yaml2elf.cpp
>
> Modified: llvm/trunk/include/llvm/Object/ELFYAML.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/ELFYAML.h?rev=184468&r1=184467&r2=184468&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/Object/ELFYAML.h (original)
> +++ llvm/trunk/include/llvm/Object/ELFYAML.h Thu Jun 20 15:59:41 2013
> @@ -57,6 +57,7 @@ struct Symbol {
> StringRef Name;
> ELF_STB Binding;
> ELF_STT Type;
> + StringRef Section;
> };
> struct Section {
> StringRef Name;
>
> Modified: llvm/trunk/lib/Object/ELFYAML.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/ELFYAML.cpp?rev=184468&r1=184467&r2=184468&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Object/ELFYAML.cpp (original)
> +++ llvm/trunk/lib/Object/ELFYAML.cpp Thu Jun 20 15:59:41 2013
> @@ -315,6 +315,7 @@ void MappingTraits<ELFYAML::Symbol>::map
> 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());
> }
>
> void MappingTraits<ELFYAML::Section>::mapping(IO &IO,
>
> Modified: llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml?rev=184468&r1=184467&r2=184468&view=diff
> ==============================================================================
> --- llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml (original)
> +++ llvm/trunk/test/Object/yaml2obj-elf-symbol-basic.yaml Thu Jun 20 15:59:41 2013
> @@ -15,6 +15,7 @@ Sections:
> - Name: main
> Binding: STB_GLOBAL
> Type: STT_FUNC
> + Section: .text
>
> # CHECK: Symbols [
> # CHECK-NEXT: Symbol {
> @@ -23,3 +24,4 @@ Sections:
> # CHECK-NEXT: Name: main
> # CHECK: Binding: Global
> # CHECK-NEXT: Type: Function
> +# CHECK: Section: .text
>
> Modified: llvm/trunk/tools/yaml2obj/yaml2elf.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/yaml2obj/yaml2elf.cpp?rev=184468&r1=184467&r2=184468&view=diff
> ==============================================================================
> --- llvm/trunk/tools/yaml2obj/yaml2elf.cpp (original)
> +++ llvm/trunk/tools/yaml2obj/yaml2elf.cpp Thu Jun 20 15:59:41 2013
> @@ -199,6 +199,13 @@ static void handleSymtabSectionHeader(
> if (!Sym.Name.empty())
> Symbol.st_name = State.getStringTable().addString(Sym.Name);
> Symbol.setBindingAndType(Sym.Binding, Sym.Type);
> + unsigned Index;
> + if (State.getSN2I().lookupSection(Sym.Section, Index)) {
> + errs() << "error: Unknown section referenced: '" << Sym.Section
> + << "' by YAML symbol " << Sym.Name << ".\n";
> + exit(1);
> + }
> + Symbol.st_shndx = Index;
> Syms.push_back(Symbol);
> }
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list