5 Commits

Author SHA1 Message Date
Daniel Rodríguez Troitiño
12285cca5e
[DWARF] Use ULEB128 and not just one byte for directory indices (#109067)
According to the standard `DW_LNCT_directory_index` can be `data1`,
`data2`, or `udata` (see 6.2.4.1). The code was using `data1`, but this
limits the number of directories to 256, even if the variable holding
the directory index is a `uint64_t`. `dsymutil` was hitting an assertion
when trying to write directory indices higher than 255.

Modify the classic and the parallel DWARF linkers to use `udata` and
encode the directory indices as ULEB128 and provide a test that has more
than 256 directories to check the changes are working as expected.

For people that were using `dsymutil` with CUs that had between 128-256
directories, this will mean that for those indices 2 bytes will be used
now, instead of just one.
2024-09-24 10:55:35 -07:00
David Tellenbach
8ab1dd3c51
[DWARFLinker] Allow emission of repeated identical discriminators (#98255)
Zero discriminator for each row in the line-table to correctly emit
repeated but identical discriminators.

Without this patch line-tables like

    0x0000000100003bac     12     20      0   0            65       0
    0x0000000100003bb4     12     30      0   0            65       0
    0x0000000100003bbc     12     28      0   0            65       0
    0x0000000100003bcc     12     17      0   0            65       0

get falsely linked as

    0x0000000100003bac     12     20      0   0            65       0
    0x0000000100003bb4     12     30      0   0             0       0
    0x0000000100003bbc     12     28      0   0             0       0
    0x0000000100003bcc     12     17      0   0             0       0
2024-07-10 16:58:03 -07:00
David Tellenbach
9f71a6bb83
[DWARFLinker] Preserve DWARF discriminators while linking (#96124)
DWARF-4 introduced DWARF discriminators but both, the classic and the
parallel DWARF linkers discarded them so far.

After applying this patch dsymutil, which uses the DWARF linkers,
correctly preserves discriminator information.
2024-06-20 22:41:17 -07:00
avl-llvm
a6b5d6dab0
[DWARFLinker] backport line table patch into the DWARFLinkerParallel. (#77497)
This patch backports https://github.com/llvm/llvm-project/pull/77016
into the DWARFLinkerParallel.
2024-01-10 12:39:37 +03:00
avl-llvm
2357e899cb
[DWARFLinker][DWARFLinkerParallel][NFC] Refactor DWARFLinker&DWARFLinkerParallel to have a common library. Part 1. (#75925)
This patch creates DWARFLinkerBase library, places DWARFLinker code into
DWARFLinker\Classic, places DWARFLinkerParallel into DWARFLinker\Parallel.
updates BOLT to use new library. This patch is NFC.
2024-01-09 11:32:08 +03:00