[llvm] [RISCV] Let -data-sections also work on sbss/sdata sections (PR #87040)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 08:36:07 PDT 2024


topperc wrote:

Do we need to update this code in lld/ELF/Writer.cpp to handle the prefix?

```
  if (config->emachine == EM_RISCV) {                                            
    // .sdata and .sbss are placed closer to make GP relaxation more profitable  
    // and match GNU ld.                                                         
    StringRef name = osec.name;                                                  
    if (name == ".sdata" || (osec.type == SHT_NOBITS && name != ".sbss"))        
      rank |= 1;                                                                 
  } 
```

Probably should be a separate patch.

https://github.com/llvm/llvm-project/pull/87040


More information about the llvm-commits mailing list