This is an archive of the discontinued LLVM Phabricator instance.

Revert r291903 and r291898. Reason: they break check-lld on the bots.
ClosedPublic

Authored by krasin on Jan 13 2017, 8:39 AM.

Details

Summary

Revert [ARM] Fix ubig32_t read in ARMAttributeParser

Now using support functions to read data instead of trying to

perform casts.

Revert [ARM] Enable objdump to construct triple for ARM

Now that The ARMAttributeParser has been moved into the library,
it has been modified so that it can parse the attributes without
printing them and stores them in a map. ELFObjectFile now queries
the attributes to fill out the architecture details of a provided
triple for 'arm' and 'thumb' targets. llvm-objdump uses this new
functionality.

Diff Detail

Repository
rL LLVM

Event Timeline

krasin updated this revision to Diff 84314.Jan 13 2017, 8:39 AM
krasin retitled this revision from to Revert r291903 and r291898. Reason: they break check-lld on the bots..
krasin updated this object.

For the record, check-lld failures can be observed here:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/2078

Testing: 0 .. 10.
FAIL: lld :: ELF/arm-data-relocs.s (165 of 1011)
******************** TEST 'lld :: ELF/arm-data-relocs.s' FAILED ********************
Script:
--
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/./bin/llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/arm-data-relocs.s -o /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/tools/lld/test/ELF/Output/arm-data-relocs.s.tmp
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/./bin/llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/Inputs/abs256.s -o /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/tools/lld/test/ELF/Output/arm-data-relocs.s.tmp256.o
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/./bin/ld.lld --full-shutdown /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/tools/lld/test/ELF/Output/arm-data-relocs.s.tmp /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/tools/lld/test/ELF/Output/arm-data-relocs.s.tmp256.o -o /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/tools/lld/test/ELF/Output/arm-data-relocs.s.tmp2
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/./bin/llvm-objdump -d /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/tools/lld/test/ELF/Output/arm-data-relocs.s.tmp2 | /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/./bin/FileCheck /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/arm-data-relocs.s
--
Exit Code: 2

Command Output (stderr):
--
=================================================================
==32435==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7f5c9250a650 at pc 0x000000ee1eff bp 0x7fff39799670 sp 0x7fff39799668
READ of size 4 at 0x7f5c9250a650 thread T0
    #0 0xee1efe in getAttributeValue /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/Support/ARMAttributeParser.h:133:34
    #1 0xee1efe in llvm::object::ELFObjectFileBase::setARMSubArch(llvm::Triple&) const /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Object/ELFObjectFile.cpp:143
    #2 0x60ffff in getTarget /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/llvm-objdump/llvm-objdump.cpp:367:14
    #3 0x60ffff in DisassembleObject(llvm::object::ObjectFile const*, bool) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/llvm-objdump/llvm-objdump.cpp:1115
    #4 0x60d270 in DumpObject(llvm::object::ObjectFile const*, llvm::object::Archive const*) /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/llvm-objdump/llvm-objdump.cpp:1977:5
    #5 0x5c7ef4 in DumpInput /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/llvm-objdump/llvm-objdump.cpp:2066:5
    #6 0x5c7ef4 in for_each<std::__1::__wrap_iter<std::__1::basic_string<char> *>, void (*)(llvm::StringRef)> /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/algorithm:879
    #7 0x5c7ef4 in main /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/llvm-objdump/llvm-objdump.cpp:2126
    #8 0x7f5c9568782f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #9 0x4c55c8 in _start (/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/bin/llvm-objdump+0x4c55c8)

Address 0x7f5c9250a650 is located in stack of thread T0 at offset 80 in frame
    #0 0xee19af in llvm::object::ELFObjectFileBase::setARMSubArch(llvm::Triple&) const /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/lib/Object/ELFObjectFile.cpp:126

  This frame has 2 object(s):
    [32, 64) 'Attributes:130'
    [96, 120) 'Triple:135' <== Memory access at offset 80 underflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/Support/ARMAttributeParser.h:133:34 in getAttributeValue
Shadow bytes around the buggy address:
  0x0fec12499470: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x0fec12499480: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x0fec12499490: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x0fec124994a0: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x0fec124994b0: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
=>0x0fec124994c0: f1 f1 f1 f1 00 00 00 00 f2 f2[f2]f2 00 00 00 f3
  0x0fec124994d0: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fec124994e0: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x0fec124994f0: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x0fec12499500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fec12499510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==32435==ABORTING
FileCheck error: '-' is empty.
FileCheck command line:  /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/./bin/FileCheck /mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/lld/test/ELF/arm-data-relocs.s
This revision was automatically updated to reflect the committed changes.
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp