[PATCH v3 4/4] libdw: Handle overflowed DW_SECT_INFO offsets in DWARF package file indexes
Omar Sandoval
osandov@osandov.com
Fri Mar 1 22:36:31 GMT 2024
On Fri, Mar 01, 2024 at 03:59:22PM +0100, Mark Wielaard wrote:
> Hi Omar,
>
> On Mon, 2024-02-26 at 11:32 -0800, Omar Sandoval wrote:
> > Meta uses DWARF package files for our large, statically-linked C++
> > applications. Some of our largest applications have more than 4GB in
> > .debug_info.dwo, but the section offsets in .debug_cu_index and
> > .debug_tu_index are 32 bits; see the discussion here [1]. We
> > implemented a workaround/extension for this in LLVM. Implement the
> > equivalent in libdw.
> >
> > To test this, we need files with more than 4GB in .debug_info.dwo. I
> > created these artificially by editing GCC's assembly output. They
> > compress down to 6KB. I test them from run-large-elf-file.sh to take
> > advantage of the existing checks for large file support.
> >
> > 1: https://discourse.llvm.org/t/dwarf-dwp-4gb-limit/63902.
> >
> > * libdw/dwarf_end.c (dwarf_package_index_free): New function.
> > * tests/testfile-dwp-4-cu-index-overflow.bz2: New test file.
> > * tests/testfile-dwp-4-cu-index-overflow.dwp.bz2: New test file.
> > * tests/testfile-dwp-5-cu-index-overflow.bz2: New test file.
> > * tests/testfile-dwp-5-cu-index-overflow.dwp.bz2: New test file.
> > * tests/testfile-dwp-cu-index-overflow.source: New file.
> > * tests/run-large-elf-file.sh: Check
> > testfile-dwp-5-cu-index-overflow and
> > testfile-dwp-4-cu-index-overflow.
>
> The hack is kind of horrible, but given that this doesn't really
> impacts "normal" dwp files and it does work with clang/lldb, lets just
> support it too.
Yup, I hate it, too. Thanks for merging this series and for the followup
fixes!
More information about the Elfutils-devel
mailing list