The DW_OP_addrx operation encodes a zero-based index into the .debug_addr section. The index is relative to the DW_AT_addr_base attribute of the associated compilation unit. In order to compute the offset into the .debug_addr section and find the associated relocation, we need to add the add the add base offset and multiply the index with the address size. This patch fixes a bug in this computation, where the multiplication was omitted. This went unnoticed because for small test cases, the index for interesting addresses (such as the main subprogram) is often zero.
rdar://110881668
I find the name ByteSize misleading. Would you be okay with renaming it to AddrSize? Then it's consistent with how dwarfdump prints the .debug_addr header.