summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-02-05 18:03:02 +0000
committerPavel Labath <labath@google.com>2018-02-05 18:03:02 +0000
commitbca95f8acc0058e23cf3c30040e2b3259cb84ddc (patch)
tree02c4019d5c0dcdd0f691c48a79745861b6ba3880
parente9a153f4145d6f78f1f1cd0b6205319f236e5fa4 (diff)
downloadbcm5719-llvm-bca95f8acc0058e23cf3c30040e2b3259cb84ddc.tar.gz
bcm5719-llvm-bca95f8acc0058e23cf3c30040e2b3259cb84ddc.zip
Add a comment explaining how the input for GetModuleSpecifications_EarlySectionHeaders was generated
Davide pointed out this would be useful if the file ever needs to be regenerated (and I certainly agree). I also replace the test binary with a slightly smaller one -- I intended to do this in the original commit, but I forgot to add it to the patch as I was juggling several things at the same time. llvm-svn: 324256
-rw-r--r--lldb/unittests/ObjectFile/ELF/Inputs/early-section-headers.sobin5815 -> 581 bytes
-rw-r--r--lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp25
2 files changed, 25 insertions, 0 deletions
diff --git a/lldb/unittests/ObjectFile/ELF/Inputs/early-section-headers.so b/lldb/unittests/ObjectFile/ELF/Inputs/early-section-headers.so
index 4d529748e5d..b4c4b2f9a4a 100644
--- a/lldb/unittests/ObjectFile/ELF/Inputs/early-section-headers.so
+++ b/lldb/unittests/ObjectFile/ELF/Inputs/early-section-headers.so
Binary files differ
diff --git a/lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp b/lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
index fe8ea7cae8a..bec46bb037e 100644
--- a/lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
+++ b/lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
@@ -102,6 +102,31 @@ TEST_F(ObjectFileELFTest, SectionsResolveConsistently) {
// Test that GetModuleSpecifications works on an "atypical" object file which
// has section headers right after the ELF header (instead of the more common
// layout where the section headers are at the very end of the object file).
+//
+// Test file generated with yaml2obj (@svn rev 324254) from the following input:
+/*
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+ Entry: 0x00000000004003D0
+Sections:
+ - Name: .note.gnu.build-id
+ Type: SHT_NOTE
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0000000000400274
+ AddressAlign: 0x0000000000000004
+ Content: 040000001400000003000000474E55001B8A73AC238390E32A7FF4AC8EBE4D6A41ECF5C9
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x00000000004003D0
+ AddressAlign: 0x0000000000000010
+ Content: DEADBEEFBAADF00D
+...
+*/
TEST_F(ObjectFileELFTest, GetModuleSpecifications_EarlySectionHeaders) {
std::string SO = GetInputFilePath("early-section-headers.so");
ModuleSpecList Specs;
OpenPOWER on IntegriCloud