You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/21 13:20:42 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request, #6121: compile/opt: add config DEBUG_LINK_MAP

anchao opened a new pull request, #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121

   ## Summary
   
   compile/opt: add config DEBUG_LINK_MAP
   
   Selecting this option will pass "-Map=$(TOPDIR)$(DELIM)nuttx.map" to ld
   when linking NuttX ELF. That file can be useful for verifying
   and debugging magic section games, and for seeing which
   pieces of code get eliminated with DEBUG_OPT_UNUSED_SECTIONS.
   
   Signed-off-by: chao.an <an...@xiaomi.com>
   
   
   ## Impact
   
   link option with "-Map=$(TOPDIR)$(DELIM)nuttx.map"
   
   ## Testing
   
   CI check


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6121: compile/opt: add config DEBUG_LINK_MAP

Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121#discussion_r855315980


##########
Kconfig:
##########
@@ -1956,6 +1956,29 @@ config DEBUG_OPTLEVEL
 		This string represents the custom optimization level that will be
 		used if DEBUG_CUSTOMOPT.
 
+config DEBUG_OPT_UNUSED_SECTIONS
+	bool "Optimization to eliminate the unused input sections"
+	default y
+	depends on ARCH_TOOLCHAIN_GNU
+	---help---
+		Use these options on systems where the linker can perform optimizations
+		to improve locality of reference in the instruction space.  Most systems
+		using the ELF object format have linkers with such optimizations.
+
+		Enable this option to optimization the unused input sections with the
+		linker by compiling with " -ffunction-sections -fdata-sections ", and
+		linking with " --gc-sections ".
+
+config DEBUG_LINK_MAP
+	bool "Generate link map file"
+	default y
+	depends on ARCH_TOOLCHAIN_GNU

Review Comment:
   Done



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #6121: compile/opt: add config DEBUG_LINK_MAP

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121


-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6121: compile/opt: add config DEBUG_LINK_MAP

Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121#discussion_r855320157


##########
Kconfig:
##########
@@ -1956,6 +1956,29 @@ config DEBUG_OPTLEVEL
 		This string represents the custom optimization level that will be
 		used if DEBUG_CUSTOMOPT.
 
+config DEBUG_OPT_UNUSED_SECTIONS

Review Comment:
   ditto



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6121: compile/opt: add config DEBUG_LINK_MAP

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121#discussion_r855252143


##########
Kconfig:
##########
@@ -1956,6 +1956,29 @@ config DEBUG_OPTLEVEL
 		This string represents the custom optimization level that will be
 		used if DEBUG_CUSTOMOPT.
 
+config DEBUG_OPT_UNUSED_SECTIONS
+	bool "Optimization to eliminate the unused input sections"
+	default y
+	depends on ARCH_TOOLCHAIN_GNU
+	---help---
+		Use these options on systems where the linker can perform optimizations
+		to improve locality of reference in the instruction space.  Most systems
+		using the ELF object format have linkers with such optimizations.
+
+		Enable this option to optimization the unused input sections with the
+		linker by compiling with " -ffunction-sections -fdata-sections ", and
+		linking with " --gc-sections ".
+
+config DEBUG_LINK_MAP
+	bool "Generate link map file"
+	default y
+	depends on ARCH_TOOLCHAIN_GNU

Review Comment:
   remove dependent since all tool chain support the map file



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6121: compile/opt: add config DEBUG_LINK_MAP

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121#discussion_r855275288


##########
Kconfig:
##########
@@ -1956,6 +1956,29 @@ config DEBUG_OPTLEVEL
 		This string represents the custom optimization level that will be
 		used if DEBUG_CUSTOMOPT.
 
+config DEBUG_OPT_UNUSED_SECTIONS

Review Comment:
   should we remove this option?



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] anchao commented on a diff in pull request #6121: compile/opt: add config DEBUG_LINK_MAP

Posted by GitBox <gi...@apache.org>.
anchao commented on code in PR #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121#discussion_r855319771


##########
Kconfig:
##########
@@ -1956,6 +1956,29 @@ config DEBUG_OPTLEVEL
 		This string represents the custom optimization level that will be
 		used if DEBUG_CUSTOMOPT.
 
+config DEBUG_OPT_UNUSED_SECTIONS
+	bool "Optimization to eliminate the unused input sections"
+	default y
+	depends on ARCH_TOOLCHAIN_GNU
+	---help---
+		Use these options on systems where the linker can perform optimizations
+		to improve locality of reference in the instruction space.  Most systems
+		using the ELF object format have linkers with such optimizations.
+
+		Enable this option to optimization the unused input sections with the
+		linker by compiling with " -ffunction-sections -fdata-sections ", and
+		linking with " --gc-sections ".
+
+config DEBUG_LINK_MAP

Review Comment:
   Emm... I think it is fine, configurable options will remove  the redundant map files for developers who do not care about  linker map infomations



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6121: compile/opt: add config DEBUG_LINK_MAP

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #6121:
URL: https://github.com/apache/incubator-nuttx/pull/6121#discussion_r855275006


##########
Kconfig:
##########
@@ -1956,6 +1956,29 @@ config DEBUG_OPTLEVEL
 		This string represents the custom optimization level that will be
 		used if DEBUG_CUSTOMOPT.
 
+config DEBUG_OPT_UNUSED_SECTIONS
+	bool "Optimization to eliminate the unused input sections"
+	default y
+	depends on ARCH_TOOLCHAIN_GNU
+	---help---
+		Use these options on systems where the linker can perform optimizations
+		to improve locality of reference in the instruction space.  Most systems
+		using the ELF object format have linkers with such optimizations.
+
+		Enable this option to optimization the unused input sections with the
+		linker by compiling with " -ffunction-sections -fdata-sections ", and
+		linking with " --gc-sections ".
+
+config DEBUG_LINK_MAP

Review Comment:
   let's remove this option? I don't see there is any reason to not generate the mapping file.



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org