You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update index.md
* Fix xxd argument
-l is len, -c is cols
* Not the Union of European Leagues of Basketball
* Add implementations to ObjC classes.
In my testing with clang-1001.0.46.4 there's no __objc_classlist generated unless the declared classes have implementations.
Copy file name to clipboardexpand all lines: docs/index.md
+10-4
Original file line number
Diff line number
Diff line change
@@ -232,7 +232,7 @@ Below the `__PAGEZERO` segment, there's the `__TEXT` segment. This segment has r
232
232
Think of this 5 value in bits...
233
233
234
234
```none
235
-
exeuctable writeable readable
235
+
executable writeable readable
236
236
1 0 1
237
237
```
238
238
@@ -358,15 +358,15 @@ The `size` member indicates the size of the `__DATA.__data` section (which is 8
358
358
Verify this with `xxd` again by dumping the raw bytes at offset **4096** (or equivalent for your compilation):
359
359
360
360
```bash
361
-
lolgrep:/tmp$ xxd -g 4 -e -s 4096 -c 8 ex
361
+
lolgrep:/tmp$ xxd -g 4 -e -s 4096 -l 8 ex
362
362
00001000: 00000008 00000007 ........
363
363
```
364
364
365
365
Breaking the options down:
366
366
*`-g 4` : group into 4 bytes
367
367
*`-e` : little endian mode
368
368
*`-s 4096`: Start at offset 4096, given by the `offset` member
369
-
*`-c 8` : Stop after displaying 8 bytes (each int was 4 bytes)
369
+
*`-l 8` : Stop after displaying 8 bytes (each int was 4 bytes)
370
370
371
371
At offset 4096 (or 0x1000 in hex) the value of 8 followed by the value of 7, matches the assigned values for `SomeGlobalInt` and `SecondGlobalInt` in the source code.
372
372
@@ -813,7 +813,7 @@ yay
813
813
814
814
In a `MH_EXECUTE` type image, any C/Objective-C/Swift function don't need to be externally available so that information can be removed from the symbol table. Why is that? A `MH_EXECUTE` type of file should be ran by itself, it shouldn't be loaded into another address space!
815
815
816
-
> **Note:** Just because there's no symbol in the symbol table for some code doesn't mean that you can't infer that a function is there. The **`LC_FUNCTION_STARTS`** load command will export a list of all the function/method locations (*only code, NOT data*) that are implemented by an image. This information is formatted in **[ULEB](https://en.wikipedia.org/wiki/ULEB)**. This is useful for debuggers and crash analytics.
816
+
> **Note:** Just because there's no symbol in the symbol table for some code doesn't mean that you can't infer that a function is there. The **`LC_FUNCTION_STARTS`** load command will export a list of all the function/method locations (*only code, NOT data*) that are implemented by an image. This information is formatted in **[ULEB](https://en.wikipedia.org/wiki/LEB128#Unsigned_LEB128)**. This is useful for debuggers and crash analytics.
817
817
818
818
What if the above code was compiled as a shared library? What would happen to the symbol table? Compile ex4.c, but now add the **`-shared`** option:
819
819
@@ -867,9 +867,15 @@ Build up an executable with Objective-C code and name it **ex5.m**:
0 commit comments