[lld] r244219 - bar
Rafael EspĂndola via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 6 08:38:43 PDT 2015
Really sorry, this should have been squashed with r244220. r244220 has
the correct commit message:
Delete broken code.
This was using a hard coded string table and getting it for every symbol.
The symbol name was already available.
On 6 August 2015 at 11:33, Rafael Espindola via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> Author: rafael
> Date: Thu Aug 6 10:33:19 2015
> New Revision: 244219
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244219&view=rev
> Log:
> bar
>
> Modified:
> lld/trunk/ELF/Symbols.cpp
>
> Modified: lld/trunk/ELF/Symbols.cpp
> URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.cpp?rev=244219&r1=244218&r2=244219&view=diff
> ==============================================================================
> --- lld/trunk/ELF/Symbols.cpp (original)
> +++ lld/trunk/ELF/Symbols.cpp Thu Aug 6 10:33:19 2015
> @@ -9,6 +9,7 @@
>
> #include "Symbols.h"
> #include "Chunks.h"
> +#include "Error.h"
> #include "InputFiles.h"
>
> using namespace llvm::object;
> @@ -17,13 +18,16 @@ using namespace lld;
> using namespace lld::elf2;
>
> template <class ELFT>
> -StringRef
> +static StringRef
> getSymbolName(const llvm::object::ELFFile<ELFT> *F,
> const typename llvm::object::ELFFile<ELFT>::Elf_Sym *S) {
> - ErrorOr<StringRef> StrTab = F->getStringTableForSymtab(*F->getDotSymtabSec());
> - if (!StrTab || S->st_name >= StrTab->size())
> - llvm::report_fatal_error("Invalid string table.");
> - return StrTab->data() + S->st_name;
> + ErrorOr<StringRef> StrTabOrErr =
> + F->getStringTableForSymtab(*F->getDotSymtabSec());
> + error(StrTabOrErr, "Invalid string table.");
> + StringRef StrTab = *StrTabOrErr;
> + if (S->st_name >= StrTab.size())
> + error("Invalid string table offset");
> + return StrTab.data() + S->st_name;
> }
>
> template <class ELFT>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list