Skip to content

refactor#4

Merged
blentle merged 256 commits intoblentle:mainfrom
rui314:main
May 13, 2022
Merged

refactor#4
blentle merged 256 commits intoblentle:mainfrom
rui314:main

Conversation

@blentle
Copy link
Copy Markdown
Owner

@blentle blentle commented May 13, 2022

No description provided.

rui314 and others added 30 commits April 15, 2022 20:02
This affects Fedora >= 35, where debuginfod is enabled by default. On
such systems, gdb shows the following interactive prompt and then waits
forever:
```
This GDB supports auto-downloading debuginfo from the following URLs:
https://debuginfod.fedoraproject.org/
Enable debuginfod for this session? (y or [n])
```

Unsetting the `DEBUGINFOD_URLS` environment variable disables the prompt
as documented here: https://fedoraproject.org/wiki/Debuginfod#Disabling

Signed-off-by: Christoph Erhardt <github@sicherha.de>
Fixes #430.

Signed-off-by: Christoph Erhardt <github@sicherha.de>
Sensitivity to this kind of image varies and could be an unneeded
friction to adopt the mold linker.
I didn't want to write a Python one-liner in the Makefile, but it
looks like it is in practice one of the most portable way to compute a
relative path.

#425
Previously, --gdb-index tries to read bogus compressed data from
input sections if input debug sections are compressed.

Fixes #431
Pointed out by Kévin Le Gouguec in #425.
mold used to support only DWARF4.

Fixes #436
mold is usually built for all supported tagets, namely, x86-64, i386,
ARM32, ARM64 and RISCV64. This is a good thing because it makes cross
compilation easy. That is, as long as you have a copy of the mold linker,
it is guaranteed to work as a cross linker.

However, during a quick debug session in which you build mold many
times, you may want to build mold only for your native target. That
greatly reduces build time because it reduces the amount of code
after template instantiation.

Therefore, in this commit, I introduced new macros,
MOLD_DEBUG_X86_64_ONLY and MOLD_DEBUG_ARM64_ONLY, to build mold for
x86-64 and ARM64 only, respectively.

These flags should never be used for production. They are solely for
debugging purpose.
This test fails on some Linux systems, and it is essentially testing
not the mold's capabilities but the running platform's capabilities.
I don't think there's a portable, guaranteed way to create an
executable shared object on Linux, so even if it happens to work,
I don't think we can guarantee that.
If a system has only Python 3, it may not have `python` command.
We don't need values of hte se DW_FORM tags, but we have to be
able to skip them in order to read a .debug_info section.
So that the dependency info is printed out even if the link will
eventually fail.
They are defined as aliases for
--plugin-opt=thinlto-{single-module,cache-dir,cache-policy}.

#336
.gdb_index contains two maps: a map from identifiers (type names,
function names or variable names) to compunits, and a map from
function address ranges to compunits. The latter is harder to create
because we needed to parse DWARF debug records to read function
address ranges. We generally don't want to do that.

This commit stops emitting address ranges. Now, .gdb_index sections
created by our linker contains the zero-length map as address ranges.
Though I'm not 100% sure if this is actually OK, it looks like gdb
works fine with that. It's at least worth a try.

#439
#396
rui314 and others added 28 commits May 11, 2022 10:32
We are not using pkg-config for zlib, so I think we can live without
it for libcrypto too.
With this fix, mold can now link git and successfully run all
git test suites.
This is an unusual scenario, but it can happen on Arch Linux, where
apparently even crt1.o has no .debug_info . So if one for whatever
reason omits -g for all compilations and then uses --gdb-index,
mold aborts.

Signed-off-by: Luboš Luňák <l.lunak@centrum.cz>
don't abort with --gdb-index if there's no .debug_info
@blentle blentle merged commit 29065ee into blentle:main May 13, 2022
blentle pushed a commit that referenced this pull request Jul 6, 2022
mold: error: undefined symbol: __atomic_fetch_add_8
>>> referenced by compress.cc
>>>               out/compress.o:(void tbb::detail::d1::fold_tree<tbb::detail::d1::tree_node>(tbb::detail::d1::node*, tbb::detail::d1::execution_data const&))>>> referenced by arch-arm64.cc
>>>               out/elf/arch-arm64.o:(tbb::detail::d2::for_each_root_task_base<__gnu_cxx::__normal_iterator<mold::elf::InputSection<mold::elf::ARM64>**, std::span<mold::elf::InputSection<mold::elf::ARM64>*, 4294967295u> >, mold::elf::create_range_extension_thunks(mold::elf::Context<mold::elf::ARM64>&, mold::elf::OutputSection<mold::elf::ARM64>&)::{lambda(mold::elf::InputSection<mold::elf::ARM64>*)#2}, mold::elf::InputSection<mold::elf::ARM64>*>::cancel(tbb::detail::d1::execution_data&))>>> referenced by arch-arm64.cc
>>>               out/elf/arch-arm64.o:(tbb::detail::d2::for_each_root_task_base<__gnu_cxx::__normal_iterator<mold::elf::InputSection<mold::elf::ARM64>**, std::span<mold::elf::InputSection<mold::elf::ARM64>*, 4294967295u> >, mold::elf::create_range_extension_thunks(mold::elf::Context<mold::elf::ARM64>&, mold::elf::OutputSection<mold::elf::ARM64>&)::{lambda(mold::elf::InputSection<mold::elf::ARM64>*)#4}, mold::elf::InputSection<mold::elf::ARM64>*>::cancel(tbb::detail::d1::execution_data&))>>> referenced 971 more times

mold: error: undefined symbol: __atomic_load_8
>>> referenced by main.cc
>>>               out/elf/main.o:(mold::elf::Context<mold::elf::X86_64>::~Context())>>> referenced by output-chunks.cc
>>>               out/macho/output-chunks.o:(mold::macho::ExportEncoder::finish())>>> referenced by main.cc
>>>               out/elf/main.o:(mold::elf::Context<mold::elf::I386>::~Context())>>> referenced 3 more times

Signed-off-by: Jan Palus <jpalus@fastmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants