This is a standalone repro case for golang/go#40879
testdatacontains logic to build an executabletestdata/reprothat:- has a
.rela.debug_rangessection - has a DWARF DIE that uses DW_AT_ranges (to force this, I used a linker script to spread the code across 2 sections at different addresses)
- has a
main.gocontains logic that prints the PC ranges oftestdata/reprotest.shwill print the PC ranges using both the Go binary, andllvm-dwarfdump, to highlight the differencemakewill compile all binaries and runtest.sh
Note: you need llvm installed (for llvm-dwarfdump). Alternatively you can change the test.sh script to use the regular dwarfdump.