[PATCH] D49351: [LLD] [COFF] Sort .relocs before all other discardable sections

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 18 15:17:01 PDT 2018


pcc added inline comments.


================
Comment at: COFF/Writer.cpp:479
     if (S->Header.Characteristics & IMAGE_SCN_MEM_DISCARDABLE)
-      return 2;
+      return 3;
     // .rsrc should come at the end of the non-discardable sections because its
----------------
I think you can make this

```
if (S->Header.Characteristics & IMAGE_SCN_MEM_DISCARDABLE)
  return 2;
```

and remove the part about `RelocSec`. The `.reloc` section will be sorted at the beginning of the discardable sections because we create it explicitly above (this is the same way that we ensure that the sections appear in the same order as link.exe); you can move your comment there.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D49351





More information about the llvm-commits mailing list