[llvm] r289954 - dwarfdump: Support/process relocations on a CU's abbrev_off

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 08:43:52 PST 2016


Hey Chris,

Would your new ObjectYAML improvements be suitable for testing this? Could
you help me have a go at porting the test case to use it instead of the
object file I just checked in?

On Fri, Dec 16, 2016 at 8:41 AM David Blaikie via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: dblaikie
> Date: Fri Dec 16 10:31:10 2016
> New Revision: 289954
>
> URL: http://llvm.org/viewvc/llvm-project?rev=289954&view=rev
> Log:
> dwarfdump: Support/process relocations on a CU's abbrev_off
>
> Input can be produced by ld -r, for example (a normal LLVM workflow
> never hits this - LLVM only ever produces a single abbrev table in an
> object (shared by multiple CUs), so the reloc's always 0, and when it's
> linked together the relocation's resolved so it doesn't need to be
> handled)
>
> Added:
>     llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64
>     llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test
> Modified:
>     llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
>
> Modified: llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp?rev=289954&r1=289953&r2=289954&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp (original)
> +++ llvm/trunk/lib/DebugInfo/DWARF/DWARFUnit.cpp Fri Dec 16 10:31:10 2016
> @@ -87,7 +87,10 @@ bool DWARFUnit::getStringOffsetSectionIt
>  bool DWARFUnit::extractImpl(DataExtractor debug_info, uint32_t
> *offset_ptr) {
>    Length = debug_info.getU32(offset_ptr);
>    Version = debug_info.getU16(offset_ptr);
> +  auto AI = InfoSection.Relocs.find(*offset_ptr);
>    uint64_t AbbrOffset = debug_info.getU32(offset_ptr);
> +  if (AI != InfoSection.Relocs.end())
> +    AbbrOffset += AI->second.second;
>    if (IndexEntry) {
>      if (AbbrOffset)
>        return false;
>
> Added: llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64?rev=289954&view=auto
>
> ==============================================================================
> Binary files
> llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64 (added)
> and llvm/trunk/test/DebugInfo/Inputs/dwarfdump-abbrev-off.elf-x86-64 Fri
> Dec 16 10:31:10 2016 differ
>
> Added: llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test?rev=289954&view=auto
>
> ==============================================================================
> --- llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test (added)
> +++ llvm/trunk/test/DebugInfo/dwarfdump-abbrev-off.test Fri Dec 16
> 10:31:10 2016
> @@ -0,0 +1,8 @@
> +RUN: llvm-dwarfdump -debug-dump=info
> %p/Inputs/dwarfdump-abbrev-off.elf-x86-64 | FileCheck %s
> +
> +Check that we apply relocations to the abbr_offset - while LLVM never
> produces
> +an object file like this, a reproduction can be produced by linking two
> simple
> +object files together with ld -r.
> +
> +CHECK: abbr_offset = 0x0000
> +CHECK: abbr_offset = 0x0010
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161216/e2496947/attachment.html>


More information about the llvm-commits mailing list