mirror of
https://github.com/rui314/mold.git
synced 2024-12-28 19:04:27 +03:00
ICF
This commit is contained in:
parent
d24fb706cb
commit
e207e95737
3
Makefile
3
Makefile
@ -11,7 +11,8 @@ LDFLAGS=-L$(TBB_LIBDIR) -Wl,-rpath=$(TBB_LIBDIR) \
|
|||||||
-L$(MALLOC_LIBDIR) -Wl,-rpath=$(MALLOC_LIBDIR)
|
-L$(MALLOC_LIBDIR) -Wl,-rpath=$(MALLOC_LIBDIR)
|
||||||
LIBS=-lcrypto -pthread -ltbb -lmimalloc
|
LIBS=-lcrypto -pthread -ltbb -lmimalloc
|
||||||
OBJS=main.o object_file.o input_sections.o output_chunks.o mapfile.o perf.o \
|
OBJS=main.o object_file.o input_sections.o output_chunks.o mapfile.o perf.o \
|
||||||
linker_script.o archive_file.o output_file.o subprocess.o gc_sections.o
|
linker_script.o archive_file.o output_file.o subprocess.o gc_sections.o \
|
||||||
|
icf.o
|
||||||
|
|
||||||
mold: $(OBJS)
|
mold: $(OBJS)
|
||||||
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
|
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
|
||||||
|
8
main.cc
8
main.cc
@ -940,6 +940,10 @@ static Config parse_nonpositional_args(std::span<std::string_view> args,
|
|||||||
conf.print_gc_sections = true;
|
conf.print_gc_sections = true;
|
||||||
} else if (read_flag(args, "no-print-gc-sections")) {
|
} else if (read_flag(args, "no-print-gc-sections")) {
|
||||||
conf.print_gc_sections = false;
|
conf.print_gc_sections = false;
|
||||||
|
} else if (read_flag(args, "icf")) {
|
||||||
|
conf.icf = true;
|
||||||
|
} else if (read_flag(args, "no-icf")) {
|
||||||
|
conf.icf = false;
|
||||||
} else if (read_flag(args, "quick-exit")) {
|
} else if (read_flag(args, "quick-exit")) {
|
||||||
conf.quick_exit = true;
|
conf.quick_exit = true;
|
||||||
} else if (read_flag(args, "no-quick-exit")) {
|
} else if (read_flag(args, "no-quick-exit")) {
|
||||||
@ -1194,6 +1198,10 @@ int main(int argc, char **argv) {
|
|||||||
if (config.gc_sections)
|
if (config.gc_sections)
|
||||||
gc_sections();
|
gc_sections();
|
||||||
|
|
||||||
|
// Merge identical read-only sections.
|
||||||
|
if (config.icf)
|
||||||
|
icf_sections();
|
||||||
|
|
||||||
// Merge string constants in SHF_MERGE sections.
|
// Merge string constants in SHF_MERGE sections.
|
||||||
handle_mergeable_strings();
|
handle_mergeable_strings();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user