[llvm-commits] [PATCH 3/3] Test case for readobj sections output. Part of fix for PR14723.
Sami Liedes
sami.liedes at iki.fi
Thu Dec 27 15:20:57 PST 2012
Test case for readobj sections output. Part of fix for PR14723.
There's still something curious in the output. For example, the first
section returned by ObjectFile::begin_sections() has an empty
name.
I couldn't figure out what a "data section" is in LLVM parlance,
but now for the .text section both .isTextSection() and
.isDataSection() are true. I can figure out what the test in
ELFObjectFile is, but the comments in the parent and other relevant
classes seem to be silent on what the expected semantics is.
The test in ELFObjectFile::isDataSection() is that ALLOC & WRITE is
set (section is allocated in memory and is writable), and the section
type is PROGBITS (section with initialized data or code). This is true
for the .text section in
test/Object/Inputs/shared-object-test.elf-i386.
Perhaps someone who knows ELF and the ObjectFile interface better
could take a look at this and see if the current output makes sense.
This is the output for the above file:
Sections:
0 0 0 rodata
.hash d4 34 4 required,rodata
.dynsym 108 80 4 required,rodata
.dynstr 188 62 1 required,rodata
.text 1f0 13 10 text,data,required
.eh_frame 204 40 4 data,required,rodata
.tdata 1244 4 4 data,required
.dynamic 1248 70 4 required
.got.plt 12b8 c 4 data,required
.data 12c4 4 4 data,required
.bss 12c8 4 4 bss,required,virtual,zeroinit
.shstrtab 0 65 1 rodata
.symtab 0 160 4 rodata
.strtab 0 78 1 rodata
Total: 14
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Test-case-for-readobj-sections-output.-Part-of-fix-f.patch
Type: text/x-patch
Size: 1834 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121228/572137b1/attachment.bin>
More information about the llvm-commits
mailing list