[Lldb-commits] [PATCH] D55422: Rename ObjectFile::GetHeaderAddress to GetBaseAddress

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 7 03:14:25 PST 2018


labath created this revision.
labath added reviewers: clayborg, jasonmolenda, amccarth, lemo, stella.stamenova.

This function was named such because in the case of MachO files, the
mach header is located at this address. However all (most?) usages of
this function were not interested in that fact, but the fact that this
address is used as the base address for expressing various relative
addresses in the object file.

For other object file formats, this name is not appropriate (and it's
probably the reason why this function was not implemented in these
classes). In the ELF case the ELF header will usually end up at this
address, but this is a result of the linker optimizing the file layout
and not a requirement of the spec. For COFF files, I believe the is no
header located at this address either.


https://reviews.llvm.org/D55422

Files:
  include/lldb/Symbol/ObjectFile.h
  source/API/SBModule.cpp
  source/Commands/CommandObjectTarget.cpp
  source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
  source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
  source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
  source/Symbol/CompactUnwindInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55422.177165.patch
Type: text/x-patch
Size: 14349 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181207/9bbf5a74/attachment-0001.bin>


More information about the lldb-commits mailing list