Skip to content

Commit

Permalink
Merge .sdata, .srodata and .sbss
Browse files Browse the repository at this point in the history
RISC-V uses these sections for small data/rodata/bss.
  • Loading branch information
rui314 committed Aug 3, 2024
1 parent 06e8bf8 commit 17a9481
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions elf/passes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,6 @@ get_output_name(Context<E> &ctx, std::string_view name, u64 flags) {
return ".ARM.extab";
}

if constexpr (is_alpha<E>) {
if (name.starts_with(".sdata."))
return ".sdata";
if (name.starts_with(".sbss."))
return ".sbss";
}

if (ctx.arg.z_keep_text_section_prefix) {
static std::string_view prefixes[] = {
".text.hot.", ".text.unknown.", ".text.unlikely.", ".text.startup.",
Expand All @@ -528,6 +521,7 @@ get_output_name(Context<E> &ctx, std::string_view name, u64 flags) {
".text.", ".data.rel.ro.", ".data.", ".rodata.", ".bss.rel.ro.", ".bss.",
".init_array.", ".fini_array.", ".tbss.", ".tdata.", ".gcc_except_table.",
".ctors.", ".dtors.", ".gnu.warning.", ".openbsd.randomdata.",
".sdata.", ".sbss.", ".srodata",
};

for (std::string_view prefix : prefixes) {
Expand Down

0 comments on commit 17a9481

Please sign in to comment.