mirror of
https://github.com/rui314/mold.git
synced 2024-12-27 10:23:41 +03:00
wip
This commit is contained in:
parent
39287cc9db
commit
253c946629
4
main.cc
4
main.cc
@ -198,8 +198,8 @@ static void create_synthetic_sections() {
|
||||
out::dynsym = new DynsymSection;
|
||||
out::dynstr = new DynstrSection;
|
||||
out::eh_frame = new EhFrameSection;
|
||||
out::copyrel = new CopyrelSection(".bss");
|
||||
out::copyrel_relro = new CopyrelSection(".bss.rel.ro");
|
||||
out::copyrel = new CopyrelSection(".dynbss");
|
||||
out::copyrel_relro = new CopyrelSection(".dynbss.rel.ro");
|
||||
|
||||
if (config.build_id.kind != BuildId::NONE)
|
||||
out::buildid = new BuildIdSection;
|
||||
|
@ -9,7 +9,8 @@ void print_map() {
|
||||
std::unordered_map<InputSection *, std::vector<Symbol *>> map;
|
||||
for (ObjectFile *file : out::objs)
|
||||
for (Symbol *sym : file->symbols)
|
||||
if (sym->file == file && sym->input_section)
|
||||
if (sym->file == file && sym->input_section &&
|
||||
sym->get_type() != STT_SECTION)
|
||||
map[sym->input_section].push_back(sym);
|
||||
|
||||
for (auto &pair : map) {
|
||||
@ -41,7 +42,7 @@ void print_map() {
|
||||
for (Symbol *sym : syms)
|
||||
std::cout << std::setw(16) << sym->get_addr()
|
||||
<< " 0 0 "
|
||||
<< sym << "\n";
|
||||
<< *sym << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,8 +22,8 @@ EOF
|
||||
clang -fuse-ld=`pwd`/../mold $t/a.o $t/b.so -o $t/exe
|
||||
readelf -a $t/exe > $t/log
|
||||
|
||||
fgrep -q '[24] .bss' $t/log
|
||||
fgrep -q '[25] .bss.rel.ro' $t/log
|
||||
fgrep -q '[24] .dynbss' $t/log
|
||||
fgrep -q '[25] .dynbss.rel.ro' $t/log
|
||||
fgrep -q '0000000000202200 100 OBJECT GLOBAL DEFAULT 24 readwrite' $t/log
|
||||
fgrep -q '0000000000202280 100 OBJECT GLOBAL DEFAULT 25 readonly' $t/log
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user