- This file was added.
|## Show that llvm-objdump can dump dynamic relocations for Elf_Rel relocations|
|## where the relocation references a symbol and where it does not.|
This looks verbose.
If you just keep things as in test/tools/llvm-readelf/ELF/reloc-types-elf-i386.test, does it work?
MaskRay: This looks verbose. If you just keep things as in `test/tools/llvm-readelf/ELF/reloc-types-elf…
Yes, I should have reduced this test input further, right now it's just and obj2yaml of an lld test with a few obvious lines removed. Will remove everything that's not needed for the relative relocation tomorrow.
arichardson: Yes, I should have reduced this test input further, right now it's just and obj2yaml of an lld…
I could add a RELATIVE reloc to a .o file as in test/tools/llvm-readelf/ELF/reloc-types-elf-i386.test, but I thought using a dynamic relocation like llvm/test/tools/llvm-readobj/ELF/dynamic-reloc.test makes more sense.
arichardson: I could add a RELATIVE reloc to a .o file as in `test/tools/llvm-readelf/ELF/reloc-types-elf…
|# RUN: yaml2obj %s -o %t|
I don't think you need the "Previously ..." sentence at all. What you probably do want to say is that this test shows that Elf_Rel relocations can be dumped for both cases with and without a corresponding symbol, something like the inline edit.
jhenderson: I don't think you need the "Previously ..." sentence at all. What you probably do want to say…
|# RUN: llvm-objdump --dynamic-reloc %t | FileCheck %s|
|# RUN: llvm-objdump -R %t | FileCheck %s|
|# CHECK: DYNAMIC RELOCATION RECORDS|
|# CHECK-NEXT: 00000030 R_386_RELATIVE *ABS*|
|# CHECK-NEXT: 00000010 R_386_NONE foo|
jhenderson: I don't think this line is useful?
I agree. I simply copied it from llvm/test/tools/llvm-objdump/X86/elf-dynamic-relocs.test. Should I drop it there too?
arichardson: I agree. I simply copied it from `llvm/test/tools/llvm-objdump/X86/elf-dynamic-relocs.test`.
It probably wouldn't hurt (just make sure that somewhere there is a lit test that shows that the file format line is printed, so that we don't lose coverage!)
jhenderson: It probably wouldn't hurt (just make sure that somewhere there is a lit test that shows that…
Looks like it's tested by llvm/test/tools/llvm-objdump/ELF/file-headers.test, so I have dropped it in this version.
arichardson: Looks like it's tested by llvm/test/tools/llvm-objdump/ELF/file-headers.test, so I have dropped…
Nit suggestion to make things line up nicely.
jhenderson: Nit suggestion to make things line up nicely.
|- Type: PT_LOAD|
|- Type: PT_DYNAMIC|
|- Name: .rel.dyn|
|Flags: [ SHF_ALLOC ]|
You probably should have Link: .dynsym here, since these are dynamic relocations (by default, it'll use the static symbol table).
jhenderson: You probably should have `Link: .dynsym` here, since these are dynamic relocations (by default…
|- Offset: 0x30|
|- Offset: 0x10|
|- Name: .dynamic|
|Flags: [ SHF_ALLOC ]|
|- Tag: DT_REL|
|- Tag: DT_RELSZ|
|- Tag: DT_RELENT|
|- Tag: DT_RELCOUNT|
|- Tag: DT_NULL|
|- Name: .data|
|Flags: [ SHF_WRITE, SHF_ALLOC ]|
|- Name: foo|
MaskRay: foo is not needed.
I've kept foo to make this test closer to llvm/test/tools/llvm-objdump/X86/elf-dynamic-relocs.test and test both relocations with and without a symbol.
arichardson: I've kept `foo` to make this test closer to llvm/test/tools/llvm-objdump/X86/elf-dynamic-relocs.