Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STUB not works with xcode 11.3 #9

Closed
lingjf opened this issue Apr 20, 2020 · 2 comments
Closed

STUB not works with xcode 11.3 #9

lingjf opened this issue Apr 20, 2020 · 2 comments

Comments

@lingjf
Copy link
Owner

lingjf commented Apr 20, 2020

STUB/MOCK not works with xcode 11.3 toolchain, but works with xcode 10.3.

@lingjf
Copy link
Owner Author

lingjf commented Apr 21, 2020

otool -x a.11.3.out
otool -x a.10.3.out
比较两个otool的输出发现text段的maxprot不一样分别是rx,rwx。
man ld
-segprot segname max_prot init_prot
Specifies the maximum and initial virtual memory protection of the named segment, name, to be max and init ,respectively.
The values for max and init are any combination of the characters r' (for read), w' (for write), x' (for execute) and -'
(no access).

@lingjf
Copy link
Owner Author

lingjf commented Apr 21, 2020

-Wl,-segprot,__TEXT,rwx,rwx
加入Linker选项,解决问题。

@lingjf lingjf closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant