The upcoming Clang 19 release will eliminate the -mrelax-all default at -O0 for x86, reducing the text section size. Assembly languages have span-dependent instructions like JMP/JCC which can vary in size. Assemblers face the “branch displacement problem” when deciding between short and long forms for instructions. Popular assemblers tend to start small and grow, optimizing code size. In LLVM, assembler relaxation deals with span-dependent instructions and is distinct from linker relaxation. -mrelax-all has been removed for RISC-V due to interaction issues. Removing -mrelax-all default at -O0 has been proposed and is expected in LLVM 19.1. Compiler benchmarks show negligible differences, making removal of -mrelax-all more viable.
https://maskray.me/blog/2024-04-27-clang-o0-output-branch-displacement-and-size-increase