Page MenuHomePhabricator

[MC][ELF] Introduce .rodata.cold section

Authored by Amir on May 11 2021, 5:00 PM.



Introduce .rodata.cold section that is used for infrequently accessed
data to improve cache utilization.

Background: BOLT performs an optimization of moving unused jump tables
to .rodata.cold section. More details are here:

Diff Detail

Event Timeline

Amir created this revision.May 11 2021, 5:00 PM
Amir published this revision for review.May 11 2021, 6:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2021, 6:09 PM
Amir retitled this revision from [MC] Add .rodata.cold section to [MC][ELF] Introduce .rodata.cold section.Fri, Jun 4, 11:13 PM
Amir edited the summary of this revision. (Show Details)
Amir added a reviewer: MaskRay.
MaskRay requested changes to this revision.EditedSat, Jun 5, 4:10 PM

The default section variables are there because they are referenced in many places internally.
I don't see that .rodata.cold needs to be a built-in default section. The application can call Ctx->getELFSection(".rodata.cold", ELF::SHT_PROGBITS, ELF::SHF_ALLOC); instead.

This revision now requires changes to proceed.Sat, Jun 5, 4:10 PM
Amir abandoned this revision.Sat, Jun 5, 8:04 PM

@MaskRay: makes sense. Will just use MCObjectFileInfo->getContext()... interface since we're only using in a single place.