[0/1] Fix Bug 28060 - Invalid offset for bitfields

Message ID 20210709231649.2969609-1-gprocida@google.com
Headers
Series Fix Bug 28060 - Invalid offset for bitfields |

Message

Giuliano Procida July 9, 2021, 11:16 p.m. UTC
  Hi Dodji.

I believe this fixes the bug as reported. I've tested with GCC and
Clang and with multiple target architectures where I could. However, I
would strongly recommend further testing and review given the history
of this issue.

Tests with a Linux kernel before / after the fix show a plain abidiff
of around 1400 lines which is large but less than I feared. The scope
of apparently breaking ABIs is at least:

- GCC 10 (except with -gdwarf-5).
- Clang 11.
- Both big endian and little endian architectures.
- Bitfields whose containing type does not have byte offset zero,
  unless their bit offset within the type as expressed by the
  DW_AT_data_bit_offset attribute is also zero and the compiler
  has omitted this attribute.

This may warrant another XML version bump, but I'll let you make that
call.

Regards,
Giuliano.

Giuliano Procida (1):
  DWARF reader: fix bitfield offset calculations

 src/abg-dwarf-reader.cc                       |   60 +-
 .../data/test-annotate/test13-pr18894.so.abi  |   54 +-
 .../data/test-annotate/test15-pr18892.so.abi  |    4 +-
 .../data/test-annotate/test17-pr19027.so.abi  |   12 +-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |    8 +-
 .../data/test-annotate/test21-pr19092.so.abi  |   44 +-
 .../PR25409-librte_bus_dpaa.so.20.0.abi       | 5258 +++++++++--------
 ...4--libcdio-0.94-2.fc26.x86_64-report.1.txt |   42 -
 .../data/test-read-dwarf/PR25007-sdhci.ko.abi |  168 +-
 .../PR25042-libgdbm-clang-dwarf5.so.6.0.0.abi |   24 +-
 .../test-read-dwarf/test13-pr18894.so.abi     |   54 +-
 .../test-read-dwarf/test15-pr18892.so.abi     |    4 +-
 .../test-read-dwarf/test17-pr19027.so.abi     |   12 +-
 ...19-pr19023-libtcmalloc_and_profiler.so.abi |    8 +-
 .../test-read-dwarf/test21-pr19092.so.abi     |   44 +-
 .../test22-pr19097-libstdc++.so.6.0.17.so.abi |   14 +-
 16 files changed, 2886 insertions(+), 2924 deletions(-)