[lld] r281084 - Compact InputSectionData from 64 to 48 bytes. NFC.

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 13:52:14 PDT 2016


Rafael,

I think this change breaks sanitizer-windows bot. Could you fix it or roll
it back?

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/28597/steps/run%20tests/logs/stdio

FAILED: bin/lld.exe
cmd.exe /C "cd . && "C:\Program Files (x86)\CMake\bin\cmake.exe" -E
vs_link_exe --intdir=tools\lld\tools\lld\CMakeFiles\lld.dir --manifests  --
C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~1\link.exe /nologo @CMakeFiles/lld.rsp
 /out:bin\lld.exe /implib:lib\lld.lib /pdb:bin\lld.pdb /version:0.0
 /machine:X86 /STACK:10000000 /INCREMENTAL:NO /subsystem:console  &&
cmd.exe /C "cd /D C:\b\slave\sanitizer-windows\build\tools\lld\tools\lld &&
"C:\Program Files (x86)\CMake\bin\cmake.exe" -E copy
C:/b/slave/sanitizer-windows/build/./bin/lld.exe
C:/b/slave/sanitizer-windows/build/./bin/lld-link.exe && cd /D
C:\b\slave\sanitizer-windows\build\tools\lld\tools\lld && "C:\Program Files
(x86)\CMake\bin\cmake.exe" -E copy
C:/b/slave/sanitizer-windows/build/./bin/lld.exe
C:/b/slave/sanitizer-windows/build/./bin/ld.lld.exe""
lldELF.lib(InputSection.cpp.obj) : error LNK2019: unresolved external
symbol "enum llvm::zlib::Status __cdecl llvm::zlib::uncompress(class
llvm::StringRef,char *,unsigned int &)" (?uncompress at zlib@llvm@
@YA?AW4Status at 12@VStringRef at 2@PADAAI at Z) referenced in function "public:
void __thiscall lld::elf::InputSectionBase<struct
llvm::object::ELFType<1,1> >::uncompress(void)" (?uncompress@
?$InputSectionBase at U?$ELFType@$00$00 at object@llvm@@@elf at lld@@QAEXXZ)


bin\lld.exe : fatal error LNK1120: 1 unresolved externals



On Fri, Sep 9, 2016 at 12:50 PM Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rafael
> Date: Fri Sep  9 14:42:11 2016
> New Revision: 281084
>
> URL: http://llvm.org/viewvc/llvm-project?rev=281084&view=rev
> Log:
> Compact InputSectionData from 64 to 48 bytes. NFC.
>
> Modified:
>     lld/trunk/ELF/InputSection.cpp
>     lld/trunk/ELF/InputSection.h
>
> Modified: lld/trunk/ELF/InputSection.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=281084&r1=281083&r2=281084&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/InputSection.cpp (original)
> +++ lld/trunk/ELF/InputSection.cpp Fri Sep  9 14:42:11 2016
> @@ -50,8 +50,8 @@ template <class ELFT> size_t InputSectio
>  template <class ELFT>
>  ArrayRef<uint8_t> InputSectionBase<ELFT>::getSectionData() const {
>    if (Compressed)
> -    return ArrayRef<uint8_t>((const uint8_t *)Uncompressed.data(),
> -                             Uncompressed.size());
> +    return ArrayRef<uint8_t>((const uint8_t *)UncompressedData.get(),
> +                             UncompressedDataSize);
>    return check(this->File->getObj().getSectionContents(this->Header));
>  }
>
> @@ -106,7 +106,10 @@ template <class ELFT> void InputSectionB
>      fatal(getName(this) + ": unsupported compression type");
>
>    StringRef Buf((const char *)Data.data(), Data.size());
> -  if (zlib::uncompress(Buf, Uncompressed, Hdr->ch_size) != zlib::StatusOK)
> +  UncompressedDataSize = Hdr->ch_size;
> +  UncompressedData.reset(new char[UncompressedDataSize]);
> +  if (zlib::uncompress(Buf, UncompressedData.get(), UncompressedDataSize)
> !=
> +      zlib::StatusOK)
>      fatal(getName(this) + ": error uncompressing section");
>  }
>
>
> Modified: lld/trunk/ELF/InputSection.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=281084&r1=281083&r2=281084&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/InputSection.h (original)
> +++ lld/trunk/ELF/InputSection.h Fri Sep  9 14:42:11 2016
> @@ -61,8 +61,9 @@ public:
>
>    StringRef Name;
>
> -  // If a section is compressed, this vector has uncompressed section
> data.
> -  SmallVector<char, 0> Uncompressed;
> +  // If a section is compressed, this has the uncompressed section data.
> +  std::unique_ptr<char[]> UncompressedData;
> +  size_t UncompressedDataSize = 0;
>
>    std::vector<Relocation> Relocations;
>  };
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-- 
Mike
Sent from phone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160909/6cc1d7f4/attachment.html>


More information about the llvm-commits mailing list