[PATCH] D44986: Initialize Elf header and Program Header to Zero

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 28 10:31:28 PDT 2018


mgrang added inline comments.


================
Comment at: lld/ELF/Writer.cpp:2111
   uint8_t *Buf = Buffer->getBufferStart();
+  memset(Buf, 0 , sizeof(Elf_Ehdr)+sizeof(Elf_Phdr));
   memcpy(Buf, "\177ELF", 4);
----------------
Please make spacing uniform.
```
memset(Buf, 0, sizeof(Elf_Ehdr) + sizeof(Elf_Phdr));
```

Also could you please add a unit test?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44986





More information about the llvm-commits mailing list