1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-27 10:23:41 +03:00
This commit is contained in:
Rui Ueyama 2021-03-14 16:36:56 +09:00
parent 6acf3c99cc
commit 96075a3e2d
2 changed files with 7 additions and 2 deletions

View File

@ -1248,6 +1248,11 @@ int main(int argc, char **argv) {
for (OutputChunk *chunk : out::chunks)
chunk->update_shdr();
erase(out::chunks, [](OutputChunk *chunk) {
return chunk->kind == OutputChunk::SYNTHETIC &&
chunk->shdr.sh_size == 0;
});
// Set section indices.
for (i64 i = 0, shndx = 1; i < out::chunks.size(); i++)
if (out::chunks[i]->kind != OutputChunk::HEADER)

View File

@ -23,8 +23,8 @@ clang -fuse-ld=`pwd`/../mold $t/a.o $t/b.so -o $t/exe
readelf -a $t/exe > $t/log
fgrep -q '[21] .dynbss.rel.ro' $t/log
fgrep -q '[24] .dynbss' $t/log
fgrep -q '[25] .dynbss' $t/log
fgrep -q '00000000002021e0 100 OBJECT GLOBAL DEFAULT 21 readonly' $t/log
fgrep -q '0000000000203040 100 OBJECT GLOBAL DEFAULT 24 readwrite' $t/log
fgrep -q '0000000000203040 100 OBJECT GLOBAL DEFAULT 25 readwrite' $t/log
echo OK