Files
clang-p2996/lldb/unittests/ObjectFile/ELF/Inputs/sections-resolve-consistently.yaml
Pavel Labath efddda3d8d ObjectFileELF: Fix symbol lookup in bss section
Summary:
If we have symbol information in a separate file, we need to be very
careful about presenting a unified section view of module to the rest of
the debugger. ObjectFileELF had code to handle that, but it was being
overly cautious -- the section->GetFileSize()!=0 meant that the
unification would fail for sections which do not occupy any space in the
object file (e.g., .bss). In my case, that manifested itself as not
being able to display the values of .bss variables properly as the
section associated with the variable did not have it's load address set
(because it was not present in the unified section list).

I test this by making sure the unified section list and the variables
refer to the same section.

Reviewers: eugene, zturner

Subscribers: tberghammer, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D32434

llvm-svn: 301917
2017-05-02 12:40:31 +00:00

51 lines
1.7 KiB
YAML

--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Entry: 0x0000000000400180
Sections:
- Name: .note.gnu.build-id
Type: SHT_NOTE
Flags: [ SHF_ALLOC ]
Address: 0x0000000000400158
AddressAlign: 0x0000000000000004
Content: 040000001400000003000000474E55003F3EC29E3FD83E49D18C4D49CD8A730CC13117B6
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x0000000000400180
AddressAlign: 0x0000000000000010
Content: 554889E58B042500106000890425041060005DC3
- Name: .data
Type: SHT_PROGBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
Address: 0x0000000000601000
AddressAlign: 0x0000000000000004
Content: 2F000000
- Name: .bss
Type: SHT_NOBITS
Flags: [ SHF_WRITE, SHF_ALLOC ]
Address: 0x0000000000601004
AddressAlign: 0x0000000000000004
Size: 0x0000000000000004
Symbols:
Global:
- Name: Y
Type: STT_OBJECT
Section: .data
Value: 0x0000000000601000
Size: 0x0000000000000004
- Name: _start
Type: STT_FUNC
Section: .text
Value: 0x0000000000400180
Size: 0x0000000000000014
- Name: X
Type: STT_OBJECT
Section: .bss
Value: 0x0000000000601004
Size: 0x0000000000000004
...