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() {
1104
1104
1105
1105
PhdrEntry *last = nullptr ;
1106
1106
PhdrEntry *lastRO = nullptr ;
1107
-
1107
+ auto isLarge = [](OutputSection *osec) {
1108
+ return config->emachine == EM_X86_64 && osec->flags & SHF_X86_64_LARGE;
1109
+ };
1108
1110
for (Partition &part : partitions) {
1109
1111
for (PhdrEntry *p : part.phdrs ) {
1110
1112
if (p->p_type != PT_LOAD)
@@ -1124,10 +1126,11 @@ template <class ELFT> void Writer<ELFT>::setReservedSymbolSections() {
1124
1126
}
1125
1127
1126
1128
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.
1128
1131
OutputSection *edata = nullptr ;
1129
1132
for (OutputSection *os : outputSections) {
1130
- if (os->type != SHT_NOBITS)
1133
+ if (os->type != SHT_NOBITS && ! isLarge (os) )
1131
1134
edata = os;
1132
1135
if (os == last->lastSec )
1133
1136
break ;
Original file line number Diff line number Diff line change 43
43
44
44
# CHECK: 0000000000201304 0 NOTYPE GLOBAL DEFAULT [[#]] (.text) _start
45
45
# 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
47
47
# CHECK-NEXT: 0000000000206d0b 0 NOTYPE GLOBAL DEFAULT [[#]] (.lbss) _end
48
48
49
49
# CHECK1: .data PROGBITS 0000000000203306 000306 000001 00 WA 0 0 1
53
53
54
54
# CHECK1: 0000000000201304 0 NOTYPE GLOBAL DEFAULT [[#]] (.text) _start
55
55
# 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
57
57
# CHECK1-NEXT: 000000000020330a 0 NOTYPE GLOBAL DEFAULT [[#]] (.ldata2) _end
58
58
59
59
# CHECK2: .note NOTE 0000000000200300 000300 000001 00 A 0 0 1
You can’t perform that action at this time.
0 commit comments