1b50200abd
Before, picking a symbol name for a Code object when generating assembly required adding a placeholder entry in the Dwarf object, because the Dwarf object separately used a SnapshotTextObjectNamer to determine the appropriate symbol name to use in relocations. Instead, now the ImageWriter subclasses are entirely responsible for creating the symbol name for a given Code object, and that name is passed when adding the Code object to the Dwarf object. For Elf output, we eagerly create symbols for sections and Code objects again in the appropriate symbol table, and so looking up the start of a given section or Code object can be done simply by asking for the corresponding symbol's address, removing special case methods and other workarounds. We also clean up the generated static and dynamic symbol tables by only generating local symbols for Code objects and BSS sections (these are local in assembly output also), and only adding global symbols to the dynamic symbol table. Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-precomp-win-release-x64-try Change-Id: Ie40c0c836681e98f345483136bb6860e5588ef30 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166002 Reviewed-by: Martin Kustermann <kustermann@google.com>