File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1104,7 +1104,9 @@ template <class ELFT> void Writer<ELFT>::setReservedSymbolSections() {
11041104
11051105 PhdrEntry *last = nullptr ;
11061106 PhdrEntry *lastRO = nullptr ;
1107-
1107+ auto isLarge = [](OutputSection *osec) {
1108+ return config->emachine == EM_X86_64 && osec->flags & SHF_X86_64_LARGE;
1109+ };
11081110 for (Partition &part : partitions) {
11091111 for (PhdrEntry *p : part.phdrs ) {
11101112 if (p->p_type != PT_LOAD)
@@ -1124,10 +1126,11 @@ template <class ELFT> void Writer<ELFT>::setReservedSymbolSections() {
11241126 }
11251127
11261128 if (last) {
1127- // _edata points to the end of the last mapped initialized section.
1129+ // _edata points to the end of the last non-large mapped initialized
1130+ // section.
11281131 OutputSection *edata = nullptr ;
11291132 for (OutputSection *os : outputSections) {
1130- if (os->type != SHT_NOBITS)
1133+ if (os->type != SHT_NOBITS && ! isLarge (os) )
11311134 edata = os;
11321135 if (os == last->lastSec )
11331136 break ;
Original file line number Diff line number Diff line change 4343
4444# CHECK: 0000000000201304 0 NOTYPE GLOBAL DEFAULT [[#]] (.text) _start
4545# CHECK-NEXT: 0000000000201305 0 NOTYPE GLOBAL DEFAULT [[#]] (.text) _etext
46- # CHECK-NEXT: 0000000000205b0a 0 NOTYPE GLOBAL DEFAULT [[#]] (.ldata2) _edata
46+ # CHECK-NEXT: 0000000000203307 0 NOTYPE GLOBAL DEFAULT [[#]] (.data) _edata
4747# CHECK-NEXT: 0000000000206d0b 0 NOTYPE GLOBAL DEFAULT [[#]] (.lbss) _end
4848
4949# CHECK1: .data PROGBITS 0000000000203306 000306 000001 00 WA 0 0 1
5353
5454# CHECK1: 0000000000201304 0 NOTYPE GLOBAL DEFAULT [[#]] (.text) _start
5555# CHECK1-NEXT: 0000000000201305 0 NOTYPE GLOBAL DEFAULT [[#]] (.text) _etext
56- # CHECK1-NEXT: 000000000020330a 0 NOTYPE GLOBAL DEFAULT [[#]] (.ldata2) _edata
56+ # CHECK1-NEXT: 0000000000203307 0 NOTYPE GLOBAL DEFAULT [[#]] (.data) _edata
5757# CHECK1-NEXT: 000000000020330a 0 NOTYPE GLOBAL DEFAULT [[#]] (.ldata2) _end
5858
5959# CHECK2: .note NOTE 0000000000200300 000300 000001 00 A 0 0 1
You can’t perform that action at this time.
0 commit comments