Commit dbd139b
committed
Prioritize using a segment with the name TEXT instead off fileoff 0
lldb needs to find the virtual address of the mach header of a
binary. It first scans for a segment which starts at file offset
0, and uses the vmaddr of that segment. If no segment starts at
fileoff 0, it looks for a segment named __TEXT.
This patch changes the order of those, to first search for the TEXT
segment. We have a situation where binaries exist that have the
DATA segment first, which does not have the vmaddr of the mach header,
it merely happens to come first in the binary file. It's an unusual
arrangement, but not breaking any rules of Mach-O. So lldb needs
to handle this.
Differential Revision: https://reviews.llvm.org/D150239
rdar://109128418
(cherry picked from commit f9759d0)1 parent 7557a46 commit dbd139b
1 file changed
+10
-8
lines changedLines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6141 | 6141 | | |
6142 | 6142 | | |
6143 | 6143 | | |
| 6144 | + | |
| 6145 | + | |
| 6146 | + | |
| 6147 | + | |
| 6148 | + | |
| 6149 | + | |
| 6150 | + | |
| 6151 | + | |
| 6152 | + | |
| 6153 | + | |
6144 | 6154 | | |
6145 | 6155 | | |
6146 | 6156 | | |
6147 | 6157 | | |
6148 | 6158 | | |
6149 | 6159 | | |
6150 | 6160 | | |
6151 | | - | |
6152 | | - | |
6153 | | - | |
6154 | | - | |
6155 | | - | |
6156 | | - | |
6157 | | - | |
6158 | | - | |
6159 | 6161 | | |
6160 | 6162 | | |
6161 | 6163 | | |
| |||
0 commit comments