[PATCH] D117216: [BOLT][DWARF] updateDWARFObjectAddressRanges: nullify low pc

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 13:03:37 PST 2022


Amir added a comment.

In D117216#3252320 <https://reviews.llvm.org/D117216#3252320>, @yota9 wrote:

> Thanks again @Amir
>
>> If golang compiler lowers to LLVM IR
>
> No, it is stand-alone compiler. The LLVM has it's own implementation but it is incompatible with the default gc and I didn't  even try to support it

Got it.

>> If not, but the compiler can emit an assembly (with all DWARF sections), it might be possible to reduce it using creduce.
>
> Do you mean to compile to object files, using creduce find the needed lines and emit it with linker? I'm not sure if it is possible. The golang compile may produce the archive files, although  I didn't try it and not sure what kind of output it has.  AFAIU it is very problematic since it is not intended to do such things, it is mostly intended to produce the ready executable files (even the SOs are used very very rarely in golang world) and it is very limited compared to the standard C compiler. But I don't exclude that using some hacks and tricks it is possible.

No, I mean to dump assembly. I did a quick google search and the following options are available:

- `go tool compile -S file.go > file.s`
- `gccgo -S test.go`

Then inspect the assembly, strip out the irrelevant parts while still preserving the integrity of DWARF data.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117216/new/

https://reviews.llvm.org/D117216



More information about the llvm-commits mailing list