This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][MC] Implement mapping symbols
ClosedPublic

Authored by jobnoorman on Jun 19 2023, 3:59 AM.

Details

Summary

Mapping symbols [1] are special ELF symbols that can be inserted to
indicate regions of code or data. A sequence of data bytes is indicated
by a $d (or $d.<any>) symbol pointing to its start while a sequence
of instructions uses a $x (or $x.<any>) symbol. This can be used,
for example, to assist disassembling a memory region containing both
data and code.

This patch implements mapping symbols for RISC-V, copying the
implementation mostly from the AArch64 target.

Note that the $x<ISA> mapping symbol, indicating an instruction
sequence with a specific ISA extension, is not implemented by this
patch. As far as I can tell, binutils doesn't implement this yet either.

Note that this patch uses the same symbol naming convention as the
AArch64 target: always use $x.i and $d.i (where i is a
monotonically increasing counter). This differs from binutils where all
symbols are named $x or $d (causing multiple symbol having the same
name). I'm not not sure whether it makes more sense to avoid duplicate
symbol names or be consistent with binutils.

Note that the handling of nop-slides inserted for alignment differs from
binutils: binutils always marks the nops as instructions ($x) while
this patch doesn't insert a symbol for the nops (so the last inserted
symbol is used). I believe binutil's behavior makes most sense but this
seems difficult to implement in LLVM as the insertion of nops is handled
by RISCVAsmBackend. At this point, inserting ELF symbols seems
impossible. Any ideas for how to handle this would be appreciated.

[1]: https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#mapping-symbol

Depends on D156190 and D156236

Diff Detail

Event Timeline

jobnoorman created this revision.Jun 19 2023, 3:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 3:59 AM
jobnoorman requested review of this revision.Jun 19 2023, 3:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 19 2023, 3:59 AM

Fix LLD tests.

I just realized that binutils doesn't recognize $x.i or $d.i symbols when reading files. That means that ELF files generated with this patch, although compliant with the spec, are not really interoperable with binutils (e.g., objdump doesn't take our symbols into account). Therefore, I think it makes sense to update this patch to only generate $x and $d symbols, unless anyone sees a problem with generating multiple symbols with the same name.

Ping.

Any thoughts on whether we should use the $d/$x (binutils) or $d.i/$x.i (LLVM AArch64) names?

Any thoughts on whether we should use the $d/$x (binutils) or $d.i/$x.i (LLVM AArch64) names?

I don't have strong opinion on which one, but consider the binutils compatibility I would slightly prefer $d and $x form.

This patch LGTM, however D137417 has implement more complete mapping symbol support, I am OK to accept/land this part first and then let D137417 to implement the rest part, and actually I am prefer this way since this patch implement some detail more right on creating mapping symbol, but I would like defer the final decision to @asb.

cc @LiDongjin

Ping.

Any thoughts on whether we should use the $d/$x (binutils) or $d.i/$x.i (LLVM AArch64) names?

Can LLVM and GNU as both assemble code that has multiple $d and or $x labels? If so, go with that. If not, there's not much to lose going with the AArch64-style version that uniquifies the labels.

This patch LGTM, however D137417 has implement more complete mapping symbol support, I am OK to accept/land this part first and then let D137417 to implement the rest part, and actually I am prefer this way since this patch implement some detail more right on creating mapping symbol, but I would like defer the final decision to @asb.

Which details are you referring to here? Both patches look mostly logically equivalent to me (ignoring the support for arch strings that this patch doesn't have).

I don't have a strong opinion about which patch should be accepted. I agree that an incremental approach is preferable so it could make sense to merge this one first. However, I don't want to make it more difficult for @LiDongjin to have to rebase their patch on mine.

Can LLVM and GNU as both assemble code that has multiple $d and or $x labels? If so, go with that. If not, there's not much to lose going with the AArch64-style version that uniquifies the labels.

I just noticed that LLVM MC doesn't accept multiple labels with the same name so that isn't an option. This means we'll be incompatible with binutils for now. But it feels like this is something that binutils should fix since the $x.i format is compliant with the spec.

Rebase.

If nobody objects, I plan to land this at some point after the release branch is
created tomorrow.

asb added a comment.Jul 24 2023, 7:47 AM

This patch LGTM, however D137417 has implement more complete mapping symbol support, I am OK to accept/land this part first and then let D137417 to implement the rest part, and actually I am prefer this way since this patch implement some detail more right on creating mapping symbol, but I would like defer the final decision to @asb.

cc @LiDongjin

If the consensus is this patch is more incremental it makes sense to land it I think.

reames added a subscriber: reames.Jul 24 2023, 8:50 AM

This patch LGTM, however D137417 has implement more complete mapping symbol support, I am OK to accept/land this part first and then let D137417 to implement the rest part, and actually I am prefer this way since this patch implement some detail more right on creating mapping symbol, but I would like defer the final decision to @asb.

cc @LiDongjin

If the consensus is this patch is more incremental it makes sense to land it I think.

+1 from me.

MaskRay added inline comments.Jul 24 2023, 8:55 AM
llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp
153

ELF uses symbol bindings and doesn't need setExternal.

Don't unnecessarily mark symbols as external

jobnoorman marked an inline comment as done.Jul 24 2023, 9:05 AM

Note on testing: several tests needed to be updated for this patch. This was mainly caused by the introduction of new symbols causing the labels in llvm-objdump to change.

I think we should fix llvm-objdump -d to not display mapping symbols... This unfortunately requires updates to many lld/test/ELF tests: https://reviews.llvm.org/D156190

Sorry that I'll go on a trip since Thursday and will be slow to respond...

llvm/test/MC/RISCV/mapping-across-sections.s
2

Ideally use llvm-readelf for testing, which retains all Elf*_Sym information. llvm-objdump -t output losses some information e.g. certain ELF symbol types are not distinguishable.

13

full stop for complete sentence comments

29

# CHECK-NOT: {{.}} is preferred to test that there is no further output. Also, avoid a blank line at the end.

jobnoorman added inline comments.Jul 25 2023, 1:07 AM
llvm/test/MC/RISCV/mapping-across-sections.s
2

Good point. One slight annoyance with implementing this is that llvm-readelf doesn't show section names, only indices. I would ideally like to avoid having to hard code indices. This could in principle be done using --elf-output-style=LLVM but this makes the CHECKs very verbose.

So before implementing this, I wanted to ask your opinion. Do you prefer hard coding indices or more verbosity in the tests (or stick with the current version)?

Note on testing: several tests needed to be updated for this patch. This was mainly caused by the introduction of new symbols causing the labels in llvm-objdump to change.

I think we should fix llvm-objdump -d to not display mapping symbols... This unfortunately requires updates to many lld/test/ELF tests: https://reviews.llvm.org/D156190

That makes sense, thanks for submitting the patch!

Just to be clear: you prefer that this patch be rebased on D156190 in order to not have to update the tests, right? In that case, I'll have to slightly extend this patch to set the SF_FormatSpecific ELF flag on mapping symbols in RISC-V. I think this should be fine.

jobnoorman edited the summary of this revision. (Show Details)

Rebase on D156190. Most changes to the tests have been removed because of this.

jobnoorman marked 2 inline comments as done.Jul 25 2023, 6:48 AM
MaskRay added inline comments.Jul 25 2023, 11:06 AM
llvm/test/MC/RISCV/mapping-across-sections.s
2

The objdump -t feature displaying the section name is the only reason I sometimes use it:)

However, you can use llvm-readelf -Ss and FileCheck captured variables, e.g.,
lld/test/ELF/copy-rel-alias.s

Use llvm-readelf -s instead of llvm-objdump -t for the tests.

Thanks for the tip @MaskRay!

jobnoorman marked 2 inline comments as done.Jul 26 2023, 12:48 AM
asb accepted this revision.Jul 28 2023, 2:11 AM

Explicitly hitting the 'LGTM' button as this has been reviewed by multiple people (with at least one explicit LGTM) - and I've just gone through all the feedback so far and all of it has been addressed.

This revision is now accepted and ready to land.Jul 28 2023, 2:11 AM
This revision was landed with ongoing or failed builds.Jul 28 2023, 2:13 AM
This revision was automatically updated to reflect the committed changes.
ayzhao added a subscriber: ayzhao.EditedJul 28 2023, 5:26 PM

This change causes the BOLT RISCV tests to fail (https://crbug.com/1468690):

[28/29] Running the BOLT regression tests
llvm-lit: /usr/local/google/home/ayzhao/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:487: note: using clang: /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang
llvm-lit: /usr/local/google/home/ayzhao/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:487: note: using ld.lld: /usr/local/google/home/ayzhao/src/llvm-project/build/bin/ld.lld
FAIL: BOLT :: RISCV/reloc-abs.s (1 of 314)
******************** TEST 'BOLT :: RISCV/reloc-abs.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -Wl,--defsym='__global_pointer$'=0x2800 -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-abs.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-abs.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s:14:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.1/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
check:14'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: BOLT-INFO: first alloc address is 0x10000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: BOLT-INFO: enabling relocation mode
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6: BOLT-INFO: static input executable detected
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            8: Binary Function "$x.1/1(*2)" after building cfg {
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:14'1     ?                                                  possible intended match
            9:  All names : $x.1/1
check:14'0     ~~~~~~~~~~~~~~~~~~~~
           10:  _start
check:14'0     ~~~~~~~~
           11:  Number : 1
check:14'0     ~~~~~~~~~~~~
           12:  State : CFG constructed
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  Address : 0x11190
check:14'0     ~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-pcrel.s (2 of 314)
******************** TEST 'BOLT :: RISCV/reloc-pcrel.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-pcrel.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-pcrel.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s:14:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.1/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
check:14'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: BOLT-INFO: first alloc address is 0x10000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: BOLT-INFO: enabling relocation mode
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6: BOLT-INFO: static input executable detected
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            8: Binary Function "$x.1/1(*2)" after building cfg {
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:14'1     ?                                                  possible intended match
            9:  All names : $x.1/1
check:14'0     ~~~~~~~~~~~~~~~~~~~~
           10:  _start
check:14'0     ~~~~~~~~
           11:  Number : 1
check:14'0     ~~~~~~~~~~~~
           12:  State : CFG constructed
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  Address : 0x11190
check:14'0     ~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-rvc-jump.s (3 of 314)
******************** TEST 'BOLT :: RISCV/reloc-rvc-jump.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-jump.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-jump.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s:8:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.0/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: BOLT-INFO: Target architecture: riscv64
check:8'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: BOLT-INFO: first alloc address is 0x10000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5: BOLT-INFO: enabling relocation mode
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           6: BOLT-INFO: static input executable detected
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: Binary Function "$x.0/1(*2)" after building cfg {
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'1     ?                                                  possible intended match
           9:  All names : $x.0/1
check:8'0     ~~~~~~~~~~~~~~~~~~~~
          10:  _start
check:8'0     ~~~~~~~~
          11:  Number : 1
check:8'0     ~~~~~~~~~~~~
          12:  State : CFG constructed
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          13:  Address : 0x11158
check:8'0     ~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-rvc-branch.s (4 of 314)
******************** TEST 'BOLT :: RISCV/reloc-rvc-branch.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-branch.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-branch.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s:8:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.0/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: BOLT-INFO: Target architecture: riscv64
check:8'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: BOLT-INFO: first alloc address is 0x10000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5: BOLT-INFO: enabling relocation mode
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           6: BOLT-INFO: static input executable detected
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: Binary Function "$x.0/1(*2)" after building cfg {
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'1     ?                                                  possible intended match
           9:  All names : $x.0/1
check:8'0     ~~~~~~~~~~~~~~~~~~~~
          10:  _start
check:8'0     ~~~~~~~~
          11:  Number : 1
check:8'0     ~~~~~~~~~~~~
          12:  State : CFG constructed
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          13:  Address : 0x11158
check:8'0     ~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-branch.s (5 of 314)
******************** TEST 'BOLT :: RISCV/reloc-branch.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-branch.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-branch.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s:8:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.0/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: BOLT-INFO: Target architecture: riscv64
check:8'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: BOLT-INFO: first alloc address is 0x10000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5: BOLT-INFO: enabling relocation mode
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           6: BOLT-INFO: static input executable detected
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: Binary Function "$x.0/1(*2)" after building cfg {
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'1     ?                                                  possible intended match
           9:  All names : $x.0/1
check:8'0     ~~~~~~~~~~~~~~~~~~~~
          10:  _start
check:8'0     ~~~~~~~~
          11:  Number : 1
check:8'0     ~~~~~~~~~~~~
          12:  State : CFG constructed
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          13:  Address : 0x11158
check:8'0     ~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-got.s (6 of 314)
******************** TEST 'BOLT :: RISCV/reloc-got.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-got.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-got.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s:14:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.1/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
check:14'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: BOLT-INFO: first alloc address is 0x10000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: BOLT-INFO: enabling relocation mode
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6: BOLT-INFO: static input executable detected
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            8: Binary Function "$x.1/1(*2)" after building cfg {
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:14'1     ?                                                  possible intended match
            9:  All names : $x.1/1
check:14'0     ~~~~~~~~~~~~~~~~~~~~
           10:  _start
check:14'0     ~~~~~~~~
           11:  Number : 1
check:14'0     ~~~~~~~~~~~~
           12:  State : CFG constructed
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  Address : 0x11200
check:14'0     ~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-jal.s (7 of 314)
******************** TEST 'BOLT :: RISCV/reloc-jal.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-jal.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-jal.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s:17:11: error: CHECK: expected string not found in input
// CHECK: jal ra, f
          ^
<stdin>:8:46: note: scanning from here
Binary Function "_start" after building cfg {
                                             ^
<stdin>:28:12: note: possible intended match here
 00000000: jal ra, ("$x.0/1")
           ^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
            3: BOLT-INFO: first alloc address is 0x10000
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
            5: BOLT-INFO: enabling relocation mode
            6: BOLT-INFO: static input executable detected
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
            8: Binary Function "_start" after building cfg {
check:17'0                                                  X error: no match found
            9:  Number : 2
check:17'0     ~~~~~~~~~~~~
           10:  State : CFG constructed
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           11:  Address : 0x1115a
check:17'0     ~~~~~~~~~~~~~~~~~~~
           12:  Size : 0x6
check:17'0     ~~~~~~~~~~~~
           13:  MaxSize : 0x6
check:17'0     ~~~~~~~~~~~~~~~
            .
            .
            .
           23:  BB Layout : .LBB01
check:17'0     ~~~~~~~~~~~~~~~~~~~~
           24: }
check:17'0     ~~
           25: .LBB01 (2 instructions, align : 1)
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  Entry Point
check:17'0     ~~~~~~~~~~~~~
           27:  CFI State : 0
check:17'0     ~~~~~~~~~~~~~~~
           28:  00000000: jal ra, ("$x.0/1")
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:17'1                ?                   possible intended match
           29:  00000004: ret
check:17'0     ~~~~~~~~~~~~~~~
           30:  CFI State: 0
check:17'0     ~~~~~~~~~~~~~~
           31:
check:17'0     ~
           32: DWARF CFI Instructions:
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           33:  <empty>
check:17'0     ~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-call.s (8 of 314)
******************** TEST 'BOLT :: RISCV/reloc-call.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-call.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-fix-riscv-calls --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-call.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s:17:11: error: CHECK: expected string not found in input
// CHECK: auipc ra, f
          ^
<stdin>:8:49: note: scanning from here
Binary Function "_start" after fix-riscv-calls {
                                                ^
<stdin>:28:12: note: possible intended match here
 00000000: auipc ra, ("$x.0/1")@plt
           ^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
            3: BOLT-INFO: first alloc address is 0x10000
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
            5: BOLT-INFO: enabling relocation mode
            6: BOLT-INFO: static input executable detected
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
            8: Binary Function "_start" after fix-riscv-calls {
check:17'0                                                     X error: no match found
            9:  Number : 2
check:17'0     ~~~~~~~~~~~~
           10:  State : CFG constructed
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           11:  Address : 0x1115a
check:17'0     ~~~~~~~~~~~~~~~~~~~
           12:  Size : 0xa
check:17'0     ~~~~~~~~~~~~
           13:  MaxSize : 0xa
check:17'0     ~~~~~~~~~~~~~~~
            .
            .
            .
           23:  BB Layout : .LBB01
check:17'0     ~~~~~~~~~~~~~~~~~~~~
           24: }
check:17'0     ~~
           25: .LBB01 (3 instructions, align : 1)
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  Entry Point
check:17'0     ~~~~~~~~~~~~~
           27:  CFI State : 0
check:17'0     ~~~~~~~~~~~~~~~
           28:  00000000: auipc ra, ("$x.0/1")@plt
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:17'1                ?                         possible intended match
           29:  00000004: jalr ra, 0(ra)
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           30:  00000008: ret
check:17'0     ~~~~~~~~~~~~~~~
           31:  CFI State: 0
check:17'0     ~~~~~~~~~~~~~~
           32:
check:17'0     ~
           33: DWARF CFI Instructions:
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
********************
Failed Tests (8):
  BOLT :: RISCV/reloc-abs.s
  BOLT :: RISCV/reloc-branch.s
  BOLT :: RISCV/reloc-call.s
  BOLT :: RISCV/reloc-got.s
  BOLT :: RISCV/reloc-jal.s
  BOLT :: RISCV/reloc-pcrel.s
  BOLT :: RISCV/reloc-rvc-branch.s
  BOLT :: RISCV/reloc-rvc-jump.s


Testing Time: 2.06s
  Skipped          :   5
  Unsupported      :   6
  Passed           : 294
  Expectedly Failed:   1
  Failed           :   8
FAILED: tools/bolt/test/CMakeFiles/check-bolt /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/CMakeFiles/check-bolt

This change causes the BOLT RISCV tests to fail (https://crbug.com/1467585):

[28/29] Running the BOLT regression tests
llvm-lit: /usr/local/google/home/ayzhao/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:487: note: using clang: /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang
llvm-lit: /usr/local/google/home/ayzhao/src/llvm-project/llvm/utils/lit/lit/llvm/config.py:487: note: using ld.lld: /usr/local/google/home/ayzhao/src/llvm-project/build/bin/ld.lld
FAIL: BOLT :: RISCV/reloc-abs.s (1 of 314)
******************** TEST 'BOLT :: RISCV/reloc-abs.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -Wl,--defsym='__global_pointer$'=0x2800 -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-abs.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-abs.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s:14:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.1/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-abs.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
check:14'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: BOLT-INFO: first alloc address is 0x10000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: BOLT-INFO: enabling relocation mode
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6: BOLT-INFO: static input executable detected
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            8: Binary Function "$x.1/1(*2)" after building cfg {
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:14'1     ?                                                  possible intended match
            9:  All names : $x.1/1
check:14'0     ~~~~~~~~~~~~~~~~~~~~
           10:  _start
check:14'0     ~~~~~~~~
           11:  Number : 1
check:14'0     ~~~~~~~~~~~~
           12:  State : CFG constructed
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  Address : 0x11190
check:14'0     ~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-pcrel.s (2 of 314)
******************** TEST 'BOLT :: RISCV/reloc-pcrel.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-pcrel.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-pcrel.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s:14:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.1/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-pcrel.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
check:14'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: BOLT-INFO: first alloc address is 0x10000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: BOLT-INFO: enabling relocation mode
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6: BOLT-INFO: static input executable detected
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            8: Binary Function "$x.1/1(*2)" after building cfg {
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:14'1     ?                                                  possible intended match
            9:  All names : $x.1/1
check:14'0     ~~~~~~~~~~~~~~~~~~~~
           10:  _start
check:14'0     ~~~~~~~~
           11:  Number : 1
check:14'0     ~~~~~~~~~~~~
           12:  State : CFG constructed
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  Address : 0x11190
check:14'0     ~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-rvc-jump.s (3 of 314)
******************** TEST 'BOLT :: RISCV/reloc-rvc-jump.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-jump.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-jump.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s:8:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.0/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-jump.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: BOLT-INFO: Target architecture: riscv64
check:8'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: BOLT-INFO: first alloc address is 0x10000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5: BOLT-INFO: enabling relocation mode
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           6: BOLT-INFO: static input executable detected
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: Binary Function "$x.0/1(*2)" after building cfg {
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'1     ?                                                  possible intended match
           9:  All names : $x.0/1
check:8'0     ~~~~~~~~~~~~~~~~~~~~
          10:  _start
check:8'0     ~~~~~~~~
          11:  Number : 1
check:8'0     ~~~~~~~~~~~~
          12:  State : CFG constructed
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          13:  Address : 0x11158
check:8'0     ~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-rvc-branch.s (4 of 314)
******************** TEST 'BOLT :: RISCV/reloc-rvc-branch.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-branch.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-rvc-branch.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s:8:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.0/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-rvc-branch.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: BOLT-INFO: Target architecture: riscv64
check:8'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: BOLT-INFO: first alloc address is 0x10000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5: BOLT-INFO: enabling relocation mode
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           6: BOLT-INFO: static input executable detected
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: Binary Function "$x.0/1(*2)" after building cfg {
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'1     ?                                                  possible intended match
           9:  All names : $x.0/1
check:8'0     ~~~~~~~~~~~~~~~~~~~~
          10:  _start
check:8'0     ~~~~~~~~
          11:  Number : 1
check:8'0     ~~~~~~~~~~~~
          12:  State : CFG constructed
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          13:  Address : 0x11158
check:8'0     ~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-branch.s (5 of 314)
******************** TEST 'BOLT :: RISCV/reloc-branch.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-branch.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-branch.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s:8:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.0/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-branch.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: BOLT-INFO: Target architecture: riscv64
check:8'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           3: BOLT-INFO: first alloc address is 0x10000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           5: BOLT-INFO: enabling relocation mode
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           6: BOLT-INFO: static input executable detected
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           8: Binary Function "$x.0/1(*2)" after building cfg {
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'1     ?                                                  possible intended match
           9:  All names : $x.0/1
check:8'0     ~~~~~~~~~~~~~~~~~~~~
          10:  _start
check:8'0     ~~~~~~~~
          11:  Number : 1
check:8'0     ~~~~~~~~~~~~
          12:  State : CFG constructed
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
          13:  Address : 0x11158
check:8'0     ~~~~~~~~~~~~~~~~~~~
           .
           .
           .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-got.s (6 of 314)
******************** TEST 'BOLT :: RISCV/reloc-got.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-got.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-got.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s:14:11: error: CHECK: expected string not found in input
// CHECK: Binary Function "_start" after building cfg {
          ^
<stdin>:1:1: note: scanning from here
BOLT-INFO: Target architecture: riscv64
^
<stdin>:8:1: note: possible intended match here
Binary Function "$x.1/1(*2)" after building cfg {
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-got.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
check:14'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            3: BOLT-INFO: first alloc address is 0x10000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: BOLT-INFO: enabling relocation mode
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6: BOLT-INFO: static input executable detected
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            8: Binary Function "$x.1/1(*2)" after building cfg {
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:14'1     ?                                                  possible intended match
            9:  All names : $x.1/1
check:14'0     ~~~~~~~~~~~~~~~~~~~~
           10:  _start
check:14'0     ~~~~~~~~
           11:  Number : 1
check:14'0     ~~~~~~~~~~~~
           12:  State : CFG constructed
check:14'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  Address : 0x11200
check:14'0     ~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-jal.s (7 of 314)
******************** TEST 'BOLT :: RISCV/reloc-jal.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-jal.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-cfg --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-jal.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s:17:11: error: CHECK: expected string not found in input
// CHECK: jal ra, f
          ^
<stdin>:8:46: note: scanning from here
Binary Function "_start" after building cfg {
                                             ^
<stdin>:28:12: note: possible intended match here
 00000000: jal ra, ("$x.0/1")
           ^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-jal.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
            3: BOLT-INFO: first alloc address is 0x10000
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
            5: BOLT-INFO: enabling relocation mode
            6: BOLT-INFO: static input executable detected
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
            8: Binary Function "_start" after building cfg {
check:17'0                                                  X error: no match found
            9:  Number : 2
check:17'0     ~~~~~~~~~~~~
           10:  State : CFG constructed
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           11:  Address : 0x1115a
check:17'0     ~~~~~~~~~~~~~~~~~~~
           12:  Size : 0x6
check:17'0     ~~~~~~~~~~~~
           13:  MaxSize : 0x6
check:17'0     ~~~~~~~~~~~~~~~
            .
            .
            .
           23:  BB Layout : .LBB01
check:17'0     ~~~~~~~~~~~~~~~~~~~~
           24: }
check:17'0     ~~
           25: .LBB01 (2 instructions, align : 1)
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  Entry Point
check:17'0     ~~~~~~~~~~~~~
           27:  CFI State : 0
check:17'0     ~~~~~~~~~~~~~~~
           28:  00000000: jal ra, ("$x.0/1")
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:17'1                ?                   possible intended match
           29:  00000004: ret
check:17'0     ~~~~~~~~~~~~~~~
           30:  CFI State: 0
check:17'0     ~~~~~~~~~~~~~~
           31:
check:17'0     ~
           32: DWARF CFI Instructions:
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           33:  <empty>
check:17'0     ~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
FAIL: BOLT :: RISCV/reloc-call.s (8 of 314)
******************** TEST 'BOLT :: RISCV/reloc-call.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-linux -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all --target=riscv64 -nostdlib -ffreestanding -Wl,--no-relax,--emit-relocs -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-call.s.tmp /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s
: 'RUN: at line 2';   /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt --print-fix-riscv-calls --print-only=_start -o /dev/null /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/RISCV/Output/reloc-call.s.tmp     | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s
--
Exit Code: 1

Command Output (stderr):
--
clang: warning: argument unused during compilation: '-ffreestanding' [-Wunused-command-line-argument]
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s:17:11: error: CHECK: expected string not found in input
// CHECK: auipc ra, f
          ^
<stdin>:8:49: note: scanning from here
Binary Function "_start" after fix-riscv-calls {
                                                ^
<stdin>:28:12: note: possible intended match here
 00000000: auipc ra, ("$x.0/1")@plt
           ^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/RISCV/reloc-call.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: Target architecture: riscv64
            2: BOLT-INFO: BOLT version: a0d8a53c7d0e6ca1c94b5d5c4a65790dd5705ef8
            3: BOLT-INFO: first alloc address is 0x10000
            4: BOLT-INFO: creating new program header table at address 0x210000, offset 0x200000
            5: BOLT-INFO: enabling relocation mode
            6: BOLT-INFO: static input executable detected
            7: BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
            8: Binary Function "_start" after fix-riscv-calls {
check:17'0                                                     X error: no match found
            9:  Number : 2
check:17'0     ~~~~~~~~~~~~
           10:  State : CFG constructed
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           11:  Address : 0x1115a
check:17'0     ~~~~~~~~~~~~~~~~~~~
           12:  Size : 0xa
check:17'0     ~~~~~~~~~~~~
           13:  MaxSize : 0xa
check:17'0     ~~~~~~~~~~~~~~~
            .
            .
            .
           23:  BB Layout : .LBB01
check:17'0     ~~~~~~~~~~~~~~~~~~~~
           24: }
check:17'0     ~~
           25: .LBB01 (3 instructions, align : 1)
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           26:  Entry Point
check:17'0     ~~~~~~~~~~~~~
           27:  CFI State : 0
check:17'0     ~~~~~~~~~~~~~~~
           28:  00000000: auipc ra, ("$x.0/1")@plt
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:17'1                ?                         possible intended match
           29:  00000004: jalr ra, 0(ra)
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           30:  00000008: ret
check:17'0     ~~~~~~~~~~~~~~~
           31:  CFI State: 0
check:17'0     ~~~~~~~~~~~~~~
           32:
check:17'0     ~
           33: DWARF CFI Instructions:
check:17'0     ~~~~~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
********************
Failed Tests (8):
  BOLT :: RISCV/reloc-abs.s
  BOLT :: RISCV/reloc-branch.s
  BOLT :: RISCV/reloc-call.s
  BOLT :: RISCV/reloc-got.s
  BOLT :: RISCV/reloc-jal.s
  BOLT :: RISCV/reloc-pcrel.s
  BOLT :: RISCV/reloc-rvc-branch.s
  BOLT :: RISCV/reloc-rvc-jump.s


Testing Time: 2.06s
  Skipped          :   5
  Unsupported      :   6
  Passed           : 294
  Expectedly Failed:   1
  Failed           :   8
FAILED: tools/bolt/test/CMakeFiles/check-bolt /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/CMakeFiles/check-bolt

Sorry, I linked to the wrong Chromium bug. The link should be https://crbug.com/1468690

So BinaryContext::getMarkerType needs to be taught about RISC-V mapping symbols then

Whoops, I completely forgot to land D153277 for this. Should be fixed now. Sorry about that @ayzhao.