File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
llvm/tools/llvm-objcopy/ELF Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -171,8 +171,7 @@ getDecompressedSizeAndAlignment(ArrayRef<uint8_t> Data) {
171
171
const bool IsGnuDebug = isDataGnuCompressed (Data);
172
172
const uint64_t DecompressedSize =
173
173
IsGnuDebug
174
- ? support::endian::read64be (reinterpret_cast <const uint64_t *>(
175
- Data.data () + ZlibGnuMagic.size ()))
174
+ ? support::endian::read64be (Data.data () + ZlibGnuMagic.size ())
176
175
: reinterpret_cast <const Elf_Chdr_Impl<ELFT> *>(Data.data ())->ch_size ;
177
176
const uint64_t DecompressedAlign =
178
177
IsGnuDebug ? 1
@@ -742,12 +741,11 @@ GnuDebugLinkSection::GnuDebugLinkSection(StringRef File) : FileName(File) {
742
741
743
742
template <class ELFT >
744
743
void ELFSectionWriter<ELFT>::visit(const GnuDebugLinkSection &Sec) {
745
- auto Buf = Out.getBufferStart () + Sec.Offset ;
746
- char *File = reinterpret_cast <char *>(Buf);
744
+ unsigned char *Buf = Out.getBufferStart () + Sec.Offset ;
747
745
Elf_Word *CRC =
748
746
reinterpret_cast <Elf_Word *>(Buf + Sec.Size - sizeof (Elf_Word));
749
747
*CRC = Sec.CRC32 ;
750
- llvm::copy (Sec.FileName , File );
748
+ llvm::copy (Sec.FileName , Buf );
751
749
}
752
750
753
751
void GnuDebugLinkSection::accept (SectionVisitor &Visitor) const {
You can’t perform that action at this time.
0 commit comments