[PATCH] D48554: Handle absolute symbols as branch targets in disassembly.
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 28 23:21:03 PDT 2018
grimar added inline comments.
================
Comment at: test/tools/llvm-objdump/call-absolute-symbol-elf.test:1
+// RUN: echo -e ".text\ncallq foo\n" | llvm-mc -filetype=obj -triple=x86_64-pc-linux - -o %t1.o
+// RUN: ld.lld --defsym foo=0x100 %t1.o -o %t2
----------------
btw, I think `\n` can be avoided here with the use of `;`.
Here is how we do such things in LLD tests:
```
# RUN: echo '.section .init_array, "aw"; .quad 0' | llvm-mc -filetype=obj -triple=x86_64-unknown-linux - -o %t.o
```
It perhaps looks a bit cleaner.
I see that you switched to use the binary file in rL335908. I think it is a better way because does not seem
that adding a dependency to ld.lld was good for llvm-objdump tests.
That is also consistent with another test we have which is test\tools\llvm-objdump\X86\phdrs.test.
A good practice is to add the description of how to rebuild the binary object used.
Because in some rare cases it might be needed, but without such descriptions, it can be a painful task.
phdrs.test, for example, contains such description. May I request you to add one too, please?
Repository:
rL LLVM
https://reviews.llvm.org/D48554
More information about the llvm-commits
mailing list