aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorNick Kledzik <kledzik@apple.com>2014-11-12 22:21:56 +0000
committerNick Kledzik <kledzik@apple.com>2014-11-12 22:21:56 +0000
commit16cfa60cbd8c792228fc9d112c5bcc1b7eb55743 (patch)
tree5424bf9cf159e408381f570d0aa5634be8391cf7 /clang/lib/CodeGen/CodeGenModule.cpp
parent0140aa8756d5a8fa58a0a02b306aa685d22caa42 (diff)
downloadllvm-16cfa60cbd8c792228fc9d112c5bcc1b7eb55743.zip
llvm-16cfa60cbd8c792228fc9d112c5bcc1b7eb55743.tar.gz
llvm-16cfa60cbd8c792228fc9d112c5bcc1b7eb55743.tar.bz2
[mach-o] Support linker synthesized mach_header symbols.
On darwin in final linked images, the __TEXT segment covers that start of the file. That means in memory a process can see the mach_header (and load commands) for every loaded image in a process. There are APIs that take and return the mach_header addresses as a way to specify a particular loaded image. For completeness, any code can get the address of the mach_header of the image it is in by using &__dso_handle. In addition there are mach-o type specific symbols like __mh_execute_header. The linker needs to supply a definition for any of these symbols if used. But the address the symbol it resolves to is not in any section. Instead it is the address of the start of the __TEXT segment. I needed to make a small change to SimpleFileNode to not override resetNextIndex() because the Driver creates a SimpleFileNode to hold the internal/implicit files that the context/writer can create. For some reason SimpleFileNode overrode resetNextIndex() to do nothing instead of reseting the index (which mach-o needs if the internal file is an archive). llvm-svn: 221822
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions