The conversation #4505 (comment) shows that there is a way to simplify DwarfLocSectionImpl#writeLocations implementations by making all the put methods in com.oracle.objectfile.elf.dwarf.DwarfSectionImpl a bit smarter. This should be implemented in a separate PR. See #4505 (comment)