[all-commits] [llvm/llvm-project] a2fef6: Revert "MCFragment: Use trailing data for fixed-si...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Aug 3 23:19:13 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2fef664c29a53bfa8a66927fcf8b2e5c9da4876
      https://github.com/llvm/llvm-project/commit/a2fef664c29a53bfa8a66927fcf8b2e5c9da4876
  Author: Fangrui Song <i at maskray.me>
  Date:   2025-08-03 (Sun, 03 Aug 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCObjectStreamer.h
    M llvm/include/llvm/MC/MCSection.h
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/MC/MCWin64EH.cpp
    M llvm/lib/MC/MCWinCOFFStreamer.cpp
    M llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
    R llvm/test/MC/ELF/many-instructions.s

  Log Message:
  -----------
  Revert "MCFragment: Use trailing data for fixed-size part"

This reverts commit f1aa6050bd90f8ec4273da55d362e23905ad3a81 (reland of #150846),
fixing conflicts.

It caused https://github.com/ClangBuiltLinux/linux/issues/2116 ,
which surfaced after a subsequent commit faa931b717c02d57f0814caa9133219040e6a85b decreased sizeof(MCFragment).

```
% /tmp/Debug/bin/clang "-cc1as" "-triple" "aarch64" "-filetype" "obj" "-main-file-name" "a.s" "-o" "a.o" "a.s"
clang: /home/ray/llvm/llvm/lib/MC/MCAssembler.cpp:615: void llvm::MCAssembler::writeSectionData(raw_ostream &, const MCSection *) const: Assertion `getContext().hadError() || OS.tell() - Start == getSectionAddressSize(*Sec)' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /tmp/Debug/bin/clang -cc1as -triple aarch64 -filetype obj -main-file-name a.s -o a.o a.s
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  libLLVMSupport.so.22.0git 0x00007cf91eb753cd llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 61
fish: Job 1, '/tmp/Debug/bin/clang "-cc1as" "…' terminated by signal SIGABRT (Abort)
```

The test is sensitive to precise fragment offsets. Using llvm-mc
-filetype=obj -triple=aarch64 a.s does not replicate the issue. However,
clang -cc1as includes an unnecessary `initSection` (adding an extra
FT_Align), which causes the problem.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list