Checklist
Issue or Suggestion Description
the Clang has a bad design to collect all unnamed string into .rodata.str?.?
For example, the MbedTLS has many self tests but we don't use it,
But it still keep many string into .rodata.str?.?
|
GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::Global); |
to
GV->setUnnamedAddr(llvm::GlobalValue::UnnamedAddr::None);
After the patch, all unnamed string would be one string per .rodata..L.str.??? section
Then we need to add a line to the linker script [ld.flash.sections] to keep string addresses.
.flash.rodata : ALIGN(0x10)
{
_flash_rodata_start = ABSOLUTE(.);
+ *(.rodata..L.*)
SECTION_MAPPINGS(flash_rodata)
So we need a option to control the enum.
Checklist
Issue or Suggestion Description
the Clang has a bad design to collect all unnamed string into .rodata.str?.?
For example, the MbedTLS has many self tests but we don't use it,
But it still keep many string into .rodata.str?.?
llvm-project/clang/lib/CodeGen/CodeGenModule.cpp
Line 7056 in c653766
to
After the patch, all unnamed string would be one string per .rodata..L.str.??? section
Then we need to add a line to the linker script [ld.flash.sections] to keep string addresses.
So we need a option to control the enum.