[PATCH] D137819: [XCOFF] support the overflow section (only relocation overflow is handled).

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 07:35:24 PST 2022


DiggerLin added inline comments.


================
Comment at: llvm/lib/MC/XCOFFObjectWriter.cpp:1085
+    for (auto &OverflowSec : OverflowSections) {
+      if (OverflowSec.RelocationCount == static_cast<uint32_t>(Sec->Index)) {
+        RelocationSizeInSec =
----------------
shchenz wrote:
> Can we add a field in `SectionEntry` struct to indicate the related overflow section index, so that we don't need the loop here? For example a new field about index to vector `OverflowSec`?
all the data in the SectionEntry  should be common to all Section. 

maybe we can delete the loop by setting the

Sec->RelocationCount as real relocation number.  

we do not need to do 


```
   // The field in the primary section header is always 65535
    // (XCOFF::RelocOverflow).
    Sec->RelocationCount = XCOFF::RelocOverflow;
```

in function
XCOFFObjectWriter::finalizeRelocationInfo

and in function XCOFFObjectWriter::writeSectionHeader
when found the 
Sec->RelocationCount >= XCOFF::RelocOverflow
we write as XCOFF::RelocOverflow ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137819/new/

https://reviews.llvm.org/D137819



More information about the llvm-commits mailing list