File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -701,7 +701,7 @@ enum RankFlags {
701
701
RF_WRITE = 1 << 15 ,
702
702
RF_EXEC_WRITE = 1 << 14 ,
703
703
RF_EXEC = 1 << 13 ,
704
- RF_PROGBITS_NOT_EXEC_OR_WRITE = 1 << 12 ,
704
+ RF_RODATA = 1 << 12 ,
705
705
RF_NON_TLS_BSS = 1 << 11 ,
706
706
RF_NON_TLS_BSS_RO = 1 << 10 ,
707
707
RF_NOT_TLS = 1 << 9 ,
@@ -755,15 +755,14 @@ static unsigned getSectionRank(const OutputSection *Sec) {
755
755
Rank |= RF_EXEC_WRITE;
756
756
else
757
757
Rank |= RF_EXEC;
758
- } else {
759
- if (IsWrite)
760
- Rank |= RF_WRITE;
758
+ } else if (IsWrite) {
759
+ Rank |= RF_WRITE;
760
+ } else if (Sec-> Type == SHT_PROGBITS) {
761
761
// Make non-executable and non-writable PROGBITS sections (e.g .rodata
762
- // .eh_frame) closer to .text . They likely contain PC or GOT relative
762
+ // .eh_frame) closer to .text. They likely contain PC or GOT relative
763
763
// relocations and there could be relocation overflow if other huge sections
764
764
// (.dynstr .dynsym) were placed in between.
765
- else if (Sec->Type == SHT_PROGBITS)
766
- Rank |= RF_PROGBITS_NOT_EXEC_OR_WRITE;
765
+ Rank |= RF_RODATA;
767
766
}
768
767
769
768
// If we got here we know that both A and B are in the same PT_LOAD.
You can’t perform that action at this time.
0 commit comments