1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-25 17:34:02 +03:00

temporary

This commit is contained in:
Rui Ueyama 2020-11-12 13:19:19 +09:00
parent 781371f242
commit 9c08415553
4 changed files with 4 additions and 23 deletions

12
main.cc
View File

@ -780,20 +780,14 @@ static void fix_synthetic_symbols(ArrayRef<OutputChunk *> chunks) {
if (chunk->kind == OutputChunk::HEADER)
continue;
if (chunk->shdr.sh_flags & SHF_ALLOC) {
stop(chunk, out::end);
if (chunk->shdr.sh_flags & SHF_ALLOC)
stop(chunk, out::_end);
}
if (chunk->shdr.sh_flags & SHF_EXECINSTR) {
stop(chunk, out::etext);
if (chunk->shdr.sh_flags & SHF_EXECINSTR)
stop(chunk, out::_etext);
}
if (chunk->shdr.sh_type != SHT_NOBITS && chunk->shdr.sh_flags & SHF_ALLOC) {
stop(chunk, out::edata);
if (chunk->shdr.sh_type != SHT_NOBITS && chunk->shdr.sh_flags & SHF_ALLOC)
stop(chunk, out::_edata);
}
}
// __start_ and __stop_ symbols

3
mold.h
View File

@ -472,11 +472,8 @@ inline Symbol *__fini_array_start;
inline Symbol *__fini_array_end;
inline Symbol *__preinit_array_start;
inline Symbol *__preinit_array_end;
inline Symbol *end;
inline Symbol *_end;
inline Symbol *etext;
inline Symbol *_etext;
inline Symbol *edata;
inline Symbol *_edata;
}

View File

@ -566,13 +566,6 @@ ObjectFile *ObjectFile::create_internal_file(ArrayRef<OutputChunk *> chunks) {
out::_etext = add("_etext", STB_GLOBAL);
out::_edata = add("_edata", STB_GLOBAL);
if (!Symbol::intern("end")->file)
out::end = add("end", STB_GLOBAL);
if (!Symbol::intern("etext")->file)
out::etext = add("etext", STB_GLOBAL);
if (!Symbol::intern("edata")->file)
out::edata = add("edata", STB_GLOBAL);
for (OutputChunk *chunk : chunks) {
if (!is_c_identifier(chunk->name))
continue;

View File

@ -4,7 +4,7 @@
// RUN: mold -o %t.exe %t1.o %t2.o
// RUN: readelf --symbols %t.exe | FileCheck %s
// CHECK: Symbol table '.symtab' contains 22 entries:
// CHECK: Symbol table '.symtab' contains 19 entries:
// CHECK: Num: Value Size Type Bind Vis Ndx Name
// CHECK: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
// CHECK: 1: 0000000000201000 0 NOTYPE LOCAL DEFAULT 8 local1
@ -25,9 +25,6 @@
// CHECK: 16: 0000000000202110 0 NOTYPE GLOBAL DEFAULT 11 _end
// CHECK: 17: 0000000000201001 0 NOTYPE GLOBAL DEFAULT 8 _etext
// CHECK: 18: 0000000000202110 0 NOTYPE GLOBAL DEFAULT 11 _edata
// CHECK: 19: 0000000000202110 0 NOTYPE GLOBAL DEFAULT 11 end
// CHECK: 20: 0000000000201001 0 NOTYPE GLOBAL DEFAULT 8 etext
// CHECK: 21: 0000000000202110 0 NOTYPE GLOBAL DEFAULT 11 edata
.globl foo, bar, this_is_global
local1: