yf13 commented on code in PR #12022:
URL: https://github.com/apache/nuttx/pull/12022#discussion_r1673331255


##########
CMakeLists.txt:
##########
@@ -758,8 +758,14 @@ if(CONFIG_BUILD_PROTECTED)
     OUTPUT_VARIABLE nuttx_user_libgcc)
 
   # reset link options for userspace to prevent sections from being 
accidentally
-  # deleted
-  set_target_properties(nuttx_user PROPERTIES LINK_OPTIONS "")
+  # deleted Toolchain link options
+  get_target_property(nuttx_user_LINK_OPTIONS nuttx_user LINK_OPTIONS)
+  list(REMOVE_ITEM nuttx_user_LINK_OPTIONS "-Wl,--gc-sections")

Review Comment:
   I don't know how @xuxin930 identified them.  My test shows that the 
`gc-sections` will cause user space ELF lacking things required by kernel side, 
thus can't boot the target. The `-Map=nuttx.map` name conflicts with that of 
kernel. As these global settings are for kernel, adjusting them for userspace 
looks reasonable. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to