Some people reflect that the test will failed randomly.
I didn't reproduce the error in my local, but I read the llvm-objdump source code, I think I find out the reason:
1, In fact this test-self is not good, (should not use -implicit-check*-not*='foo'). //objdump tool will show foo here.
2, This simple-executable-x86_64.yaml file will generate un-relocatable obj file by tool yaml2obj.
3,For un-relocatable obj file, llvm-objdump will find a target address(related with a symbol) at follow ways:
3-1: collect all symbol with its section. 3-2: sort the sections with the start address order. 3-3: find which section the target address in. 3-4: find the right symbol in that section.
4, the error for this test is that, there are several sections have the some start address 0x00000000. So
it random go to the wrong section to find the target address's symbol. In other word, it some times don't know
which section is right when there more than one sections have the same target address the instruction needed.
ymbol table '.symtab' contains 12 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 .text
2: 0000000000000010 0 SECTION LOCAL DEFAULT 2 .anothertext
3: 0000000000000050 0 SECTION LOCAL DEFAULT 3 .eh_frame
4: 00000000000000a8 0 SECTION LOCAL DEFAULT 4 .data
5: 0000000000000000 0 SECTION LOCAL DEFAULT 5 .comment
6: 0000000000000000 0 FILE LOCAL DEFAULT UND /tmp/a.c
7: 0000000000000000 0 FILE LOCAL DEFAULT UND
8: 0000000000000045 0 OBJECT GLOBAL DEFAULT 2 somedata
9: 0000000000000010 63 FUNC GLOBAL DEFAULT 2 main
10: 0000000000000000 13 FUNC GLOBAL DEFAULT 1 foo
11: 00000000000000a8 4 OBJECT GLOBAL DEFAULT 4 a