The invention relates to an efficient
linker design method based on multi-thread collaborative optimization. Firstly, dynamic task division and
priority queue scheduling are adopted, the link process is decomposed into a plurality of task units capable of being executed in parallel, and the computing power of a multi-core processor is fully utilized. Secondly, a hierarchical symbol table is introduced, hot symbols are stored in a lockless
hash table, cold data are stored in a read-write lock protected red-black tree, thread competition is effectively reduced, and efficient concurrent access is achieved; and meanwhile, a sectional
relocation table and a progress counter supported by atomic operation are adopted, so that the
concurrency performance is further improved. And finally, generating an intermediate file with a dependency
label through a
compiler, pre-obtaining a symbol dependency relationship and a
dependency graph between modules, avoiding repeated analysis, and designing a dynamic feedback mechanism, so that the
linker can feed back optimization data to the
compiler to form a closed-
loop optimization system. The method is suitable for large-scale projects and high-
performance computing scenes, and the
resource utilization rate is optimized while the link speed is increased.