[llvm] r292169 - [llvm-objdump] Dump PT_GNU_RELRO as part of -p.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 14:58:27 PST 2017


Author: davide
Date: Mon Jan 16 16:58:26 2017
New Revision: 292169

URL: http://llvm.org/viewvc/llvm-project?rev=292169&view=rev
Log:
[llvm-objdump] Dump PT_GNU_RELRO as part of -p.

PR: 31641

Added:
    llvm/trunk/test/Object/Inputs/phdrs.elf-x86-64   (with props)
    llvm/trunk/test/tools/llvm-objdump/X86/phdrs.test
Modified:
    llvm/trunk/tools/llvm-objdump/ELFDump.cpp

Added: llvm/trunk/test/Object/Inputs/phdrs.elf-x86-64
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/Inputs/phdrs.elf-x86-64?rev=292169&view=auto
==============================================================================
Binary files llvm/trunk/test/Object/Inputs/phdrs.elf-x86-64 (added) and llvm/trunk/test/Object/Inputs/phdrs.elf-x86-64 Mon Jan 16 16:58:26 2017 differ

Propchange: llvm/trunk/test/Object/Inputs/phdrs.elf-x86-64
------------------------------------------------------------------------------
    svn:executable = *

Added: llvm/trunk/test/tools/llvm-objdump/X86/phdrs.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/phdrs.test?rev=292169&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/phdrs.test (added)
+++ llvm/trunk/test/tools/llvm-objdump/X86/phdrs.test Mon Jan 16 16:58:26 2017
@@ -0,0 +1,18 @@
+## phdrs.elf-x86-64 was generated using lld (3.9).
+## llvm-mc -filetype=obj -triple=x86_64-unknown-linux test.s -o test.o
+## lld test.o -o phdrs.elf-x86-64
+##
+## test.s:
+## .global _start
+## _start:
+##
+## .global d
+## .section .foo,"awT", at progbits
+## d:
+## .long 2
+##
+RUN: llvm-objdump -p %p/../../../Object/Inputs/phdrs.elf-x86-64 \
+RUN:     | FileCheck %s
+
+CHECK: RELRO off    0x0000000000001000 vaddr 0x0000000000201000 paddr 0x0000000000201000 align 2**0
+CHECK-NEXT:      filesz 0x0000000000000004 memsz 0x0000000000001000 flags r--

Modified: llvm/trunk/tools/llvm-objdump/ELFDump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/ELFDump.cpp?rev=292169&r1=292168&r2=292169&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/ELFDump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/ELFDump.cpp Mon Jan 16 16:58:26 2017
@@ -36,6 +36,9 @@ template <class ELFT> void printProgramH
     case ELF::PT_GNU_EH_FRAME:
       outs() << "EH_FRAME ";
       break;
+    case ELF::PT_GNU_RELRO:
+      outs() << "   RELRO ";
+      break;
     case ELF::PT_GNU_STACK:
       outs() << "   STACK ";
       break;




More information about the llvm-commits mailing list