[all-commits] [llvm/llvm-project] e83e8e: [MC] Restore default section classification to Sec...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Aug 9 13:29:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e83e8e271169f06e78cd1b6c2bab5e2926f29ff1
      https://github.com/llvm/llvm-project/commit/e83e8e271169f06e78cd1b6c2bab5e2926f29ff1
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-08-09 (Wed, 09 Aug 2023)

  Changed paths:
    M llvm/lib/MC/MCContext.cpp

  Log Message:
  -----------
  [MC] Restore default section classification to SectionKind::getReadOnly()

D133456 changed the default `Kind = SectionKind::getReadOnly();` to
`SectionKind::getText()` to work around a longstanding issue in producing
R_RISCV_{ADD,SUB}* relocations.

D155357 properly fixed the issue and the workaround is no longer needed.
getReadonly() actually matches BFD better as BFD doesn't set SEC_CODE to
a not-well-known section.

To the best of my knowledge, this change is un-testable after D155357
removed a `getKind().isText()` use.




More information about the All-commits mailing list