[PATCH] [lld][PECOFF] Take into account all sections when setting size fields in the PE header

Shankar Easwaran shankare at codeaurora.org
Fri Sep 13 11:30:18 PDT 2013


Cant this be done while you write the output file. You need to write 
every section anyways and you can avoid these loops.

Thanks

Shankar Easwaran

On 9/13/2013 1:03 PM, Rui Ueyama wrote:
>
> ================
> Comment at: lib/ReaderWriter/PECOFF/WriterPECOFF.cpp:472
> @@ +471,3 @@
> +
> +  virtual bool isCodeSection() {
> +    return _sectionHeader.Characteristics & llvm::COFF::IMAGE_SCN_CNT_CODE;
> ----------------
> Why virtual?
>
> ================
> Comment at: lib/ReaderWriter/PECOFF/WriterPECOFF.cpp:923
> @@ +922,3 @@
> +
> +  uint64_t calcSizeOfInitializedData() {
> +    uint64_t ret = 0;
> ----------------
> I'd define a helper function calculateSectionSize(SectionCharacteristics) containing the for loop and use it in the following three functions, rather than repeating the same loop three times.
>
>
> http://llvm-reviews.chandlerc.com/D1616
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation




More information about the llvm-commits mailing list