Skip to content

Commit b9efbed

Browse files
committed
Revert "Move HIP fatbin sections farther away from .text"
This reverts commit 048f350. This reverts commit f7bbc40. Related to #95949. A developer with no prior lld contribution and very little AMD contribution sneaked in these application-specific section order rules we discourage.
1 parent 1a4d6de commit b9efbed

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

lld/ELF/Writer.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,6 @@ static bool isRelroSection(Ctx &ctx, const OutputSection *sec) {
650650
enum RankFlags {
651651
RF_NOT_ADDR_SET = 1 << 27,
652652
RF_NOT_ALLOC = 1 << 26,
653-
RF_HIP_FATBIN = 1 << 19,
654653
RF_PARTITION = 1 << 18, // Partition number (8 bits)
655654
RF_LARGE_ALT = 1 << 15,
656655
RF_WRITE = 1 << 14,
@@ -748,15 +747,6 @@ unsigned elf::getSectionRank(Ctx &ctx, OutputSection &osec) {
748747
if (osec.type == SHT_NOBITS)
749748
rank |= RF_BSS;
750749

751-
// Put HIP fatbin related sections further away to avoid wasting relocation
752-
// range to jump over them. Make sure .hip_fatbin is the furthest.
753-
if (osec.name == ".hipFatBinSegment")
754-
rank |= RF_HIP_FATBIN;
755-
if (osec.name == ".hip_gpubin_handle")
756-
rank |= RF_HIP_FATBIN | 2;
757-
if (osec.name == ".hip_fatbin")
758-
rank |= RF_HIP_FATBIN | RF_WRITE | 3;
759-
760750
// Some architectures have additional ordering restrictions for sections
761751
// within the same PT_LOAD.
762752
if (ctx.arg.emachine == EM_PPC64) {

lld/test/ELF/hip-section-layout.s

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)