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/09/22 02:31:28 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 opened a new pull request, #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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

   ## Summary
   The symbol generated by linker is always used as an address not a value.
   
   ## Impact
   Code refactor
   
   ## Testing
   
   


-- 
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] gustavonihei commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
boards/risc-v/esp32c3/esp32c3-devkit/kernel/esp32c3_userspace.c:
##########
@@ -59,15 +59,15 @@
  *    of _data.  like:  uint32_t *pdata = &_sdata;
  */
 
-extern uint32_t _stext;           /* Start of .text */
-extern uint32_t _etext;           /* End+1 of .text + .rodata */
-extern const uint32_t _eronly;    /* End+1 of read only section */
-extern uint32_t _sdata;           /* Start of .data */
-extern uint32_t _edata;           /* End+1 of .data */
-extern uint32_t _sbss;            /* Start of .bss */
-extern uint32_t _ebss;            /* End+1 of .bss */
+extern uint8_t _stext[];           /* Start of .text */
+extern uint8_t _etext[];           /* End_1 of .text + .rodata */
+extern const uint8_t _eronly[];    /* End+1 of read only section (.text + .rodata) */
+extern uint8_t _sdata[];           /* Start of .data */
+extern uint8_t _edata[];           /* End+1 of .data */
+extern uint8_t _sbss[];            /* Start of .bss */
+extern uint8_t _ebss[];            /* End+1 of .bss */
 
-extern uintptr_t *__ld_udram_end; /* End+1 of user ram section */
+extern uint8_t __ld_usram_end[];   /* End+1 of user ram section */

Review Comment:
   ```suggestion
   extern uint8_t __ld_udram_end[];   /* End+1 of user ram section */
   ```
   CI complained about this one.



-- 
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] gustavonihei commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/xtensa/src/esp32s2/esp32s2_start.c:
##########
@@ -319,15 +319,15 @@ static void noreturn_function IRAM_ATTR __esp32s2_start(void)
 
   /* Move CPU0 exception vectors to IRAM */
 
-  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (&_init_start));
+  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (_init_start));
 
   /* Clear .bss.  We'll do this inline (vs. calling memset) just to be
    * certain that there are no issues with the state of global variables.
    */
 
-  for (uint32_t *dest = &_sbss; dest < &_ebss; dest++)
+  for (uint32_t dest = (uint32_t *)_sbss; dest < (uint32_t *)_ebss; )

Review Comment:
   ```suggestion
     for (uint32_t *dest = (uint32_t *)_sbss; dest < (uint32_t *)_ebss; )
   ```
   Part of this change seems wrong, `dest` should still be declared as a pointer to `uint32_t`.



-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
libs/libc/misc/lib_cxx_initialize.c:
##########
@@ -71,11 +71,11 @@ void lib_cxx_initialize(void)
 #else
       initializer_t *initp;
 
-      sinfo("_sinit: %p _einit: %p\n", &_sinit, &_einit);
+      sinfo("_sinit: %p _einit: %p\n", _sinit, _einit);
 
       /* Visit each entry in the initialization table */
 
-      for (initp = &_sinit; initp != &_einit; initp++)
+      for (initp = _sinit; initp != _einit; initp++)

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/xtensa/src/esp32s3/esp32s3_start.c:
##########
@@ -248,15 +248,15 @@ void noreturn_function IRAM_ATTR __esp32s3_start(void)
 
   /* Move CPU0 exception vectors to IRAM */
 
-  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (&_init_start));
+  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (_init_start));
 
   /* Clear .bss. We'll do this inline (vs. calling memset) just to be
    * certain that there are no issues with the state of global variables.
    */
 
-  for (uint32_t *dest = &_sbss; dest < &_ebss; dest++)
+  for (uint32_t dest = (uint32_t *)_sbss; dest < (uint32_t *)_ebss; )

Review Comment:
   Fixed.



##########
arch/xtensa/src/esp32s2/esp32s2_start.c:
##########
@@ -319,15 +319,15 @@ static void noreturn_function IRAM_ATTR __esp32s2_start(void)
 
   /* Move CPU0 exception vectors to IRAM */
 
-  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (&_init_start));
+  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (_init_start));
 
   /* Clear .bss.  We'll do this inline (vs. calling memset) just to be
    * certain that there are no issues with the state of global variables.
    */
 
-  for (uint32_t *dest = &_sbss; dest < &_ebss; dest++)
+  for (uint32_t dest = (uint32_t *)_sbss; dest < (uint32_t *)_ebss; )

Review Comment:
   Fixed.



-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/xmc4/xmc4_start.c:
##########
@@ -66,7 +66,7 @@ static inline void xmc4_flash_waitstates(void);
  * 0x2002:ffff - End of internal SRAM and end of heap (a
  */
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

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 commented on pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7160:
URL: https://github.com/apache/incubator-nuttx/pull/7160#issuecomment-1254581011

   Please ignore this warning:
   /home/runner/work/incubator-nuttx/incubator-nuttx/nuttx/arch/arm/src/phy62xx/start.c:169:6: error: Mixed case identifier found


-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
boards/risc-v/esp32c3/esp32c3-devkit/kernel/esp32c3_userspace.c:
##########
@@ -59,15 +59,15 @@
  *    of _data.  like:  uint32_t *pdata = &_sdata;
  */
 
-extern uint32_t _stext;           /* Start of .text */
-extern uint32_t _etext;           /* End+1 of .text + .rodata */
-extern const uint32_t _eronly;    /* End+1 of read only section */
-extern uint32_t _sdata;           /* Start of .data */
-extern uint32_t _edata;           /* End+1 of .data */
-extern uint32_t _sbss;            /* Start of .bss */
-extern uint32_t _ebss;            /* End+1 of .bss */
+extern uint8_t _stext[];           /* Start of .text */
+extern uint8_t _etext[];           /* End_1 of .text + .rodata */
+extern const uint8_t _eronly[];    /* End+1 of read only section (.text + .rodata) */
+extern uint8_t _sdata[];           /* Start of .data */
+extern uint8_t _edata[];           /* End+1 of .data */
+extern uint8_t _sbss[];            /* Start of .bss */
+extern uint8_t _ebss[];            /* End+1 of .bss */
 
-extern uintptr_t *__ld_udram_end; /* End+1 of user ram section */
+extern uint8_t __ld_usram_end[];   /* End+1 of user ram section */

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/rp2040/rp2040_start.c:
##########
@@ -41,7 +41,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define IDLE_STACK ((uint32_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define IDLE_STACK ((uint32_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

Review Comment:
   Done.



##########
arch/arm/src/stm32h7/stm32_start.c:
##########
@@ -62,7 +62,7 @@
  * 0x2005:ffff - End of internal SRAM and end of heap (a
  */
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/common/arm_internal.h:
##########
@@ -106,17 +106,17 @@
 #  define _START_DATA  __sfb(".data")
 #  define _END_DATA    __sfe(".data")
 #else
-#  define _START_TEXT  &_stext

Review Comment:
   Any code which use link symbols directly without these macros isn't compatible with IAR, but it isn't a problem introduced by this patch.



-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/common/arm_internal.h:
##########
@@ -106,17 +106,17 @@
 #  define _START_DATA  __sfb(".data")
 #  define _END_DATA    __sfe(".data")
 #else
-#  define _START_TEXT  &_stext

Review Comment:
   Any code which use link symbols directly without these macro isn't compatible with IAR, but it isn't a problem introduced by this patch.



-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/xtensa/src/esp32s2/esp32s2_allocateheap.c:
##########
@@ -59,13 +59,12 @@
 
 void up_allocate_heap(void **heap_start, size_t *heap_size)
 {
-  extern uint32_t *_dram0_rtos_reserved_start;
+  extern char _dram0_rtos_reserved_start[];

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] gustavonihei commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/xtensa/src/esp32s3/esp32s3_start.c:
##########
@@ -248,15 +248,15 @@ void noreturn_function IRAM_ATTR __esp32s3_start(void)
 
   /* Move CPU0 exception vectors to IRAM */
 
-  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (&_init_start));
+  __asm__ __volatile__ ("wsr %0, vecbase\n"::"r" (_init_start));
 
   /* Clear .bss. We'll do this inline (vs. calling memset) just to be
    * certain that there are no issues with the state of global variables.
    */
 
-  for (uint32_t *dest = &_sbss; dest < &_ebss; dest++)
+  for (uint32_t dest = (uint32_t *)_sbss; dest < (uint32_t *)_ebss; )

Review Comment:
   ```suggestion
     for (uint32_t *dest = (uint32_t *)_sbss; dest < (uint32_t *)_ebss; )
   ```
   Part of this change seems wrong, `dest` should still be declared as a pointer to `uint32_t`.



-- 
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] gustavonihei commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/xtensa/src/esp32s2/esp32s2_allocateheap.c:
##########
@@ -59,13 +59,12 @@
 
 void up_allocate_heap(void **heap_start, size_t *heap_size)
 {
-  extern uint32_t *_dram0_rtos_reserved_start;
+  extern char _dram0_rtos_reserved_start[];

Review Comment:
   ```suggestion
     extern uint8_t _dram0_rtos_reserved_start[];
   ```
   CI error:
   ```
   chip/esp32s2_allocateheap.c: In function 'up_allocate_heap':
   Error: chip/esp32s2_allocateheap.c:67:43: error: invalid operands to binary - (have 'char *' and 'uint8_t *' {aka 'unsigned char *'})
      *heap_size = _dram0_rtos_reserved_start - _sheap;
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   make[1]: *** [Makefile:120: esp32s2_allocateheap.o] Error 1
   make[1]: Target 'libarch.a' not remade because of errors.
   make: *** [tools/LibTargets.mk:152: arch/xtensa/src/libarch.a] Error 2
   make: Target 'all' not remade because of errors.
   ```



-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/cxd56xx/cxd56_farapi.c:
##########
@@ -106,7 +106,7 @@ struct farmsg_s
  * Public Data
  ****************************************************************************/
 
-extern char _image_modlist_base[];
+extern uint8_t _image_modlist_base[];

Review Comment:
   Done.



##########
arch/arm/src/cxd56xx/cxd56_farapi.c:
##########
@@ -230,7 +230,7 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist)
   api = &msg.u.api;
 
   msg.cpuid      = getreg32(CPU_ID);
-  msg.modid      = mlist - (struct modulelist_s *)&_image_modlist_base;
+  msg.modid      = mlist - (struct modulelist_s *)_image_modlist_base;

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/rtl8720c/ameba_nvic.c:
##########
@@ -316,7 +316,7 @@ void up_irqinitialize(void)
 
   /* Restore the NVIC vector location to local */
 
-  memcpy(&__vectors, (void *) * (volatile uint32_t *)(NVIC_VECTAB)
+  memcpy(__vectors, (void *) * (volatile uint32_t *)(NVIC_VECTAB)

Review Comment:
   No, __vectors is an array defined at line 63:
   ```
   static int (* __vectors[NR_IRQS - NVIC_IRQ_FIRST])(void);
   ```
   not a link symbol.



-- 
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] pkarashchenko merged pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


-- 
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] pkarashchenko commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/common/arm_internal.h:
##########
@@ -106,17 +106,17 @@
 #  define _START_DATA  __sfb(".data")
 #  define _END_DATA    __sfe(".data")
 #else
-#  define _START_TEXT  &_stext

Review Comment:
   What about the IAR case? Is the rest of the code still compatible?



-- 
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] pkarashchenko commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/cxd56xx/cxd56_allocateheap.c:
##########
@@ -115,7 +115,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
 
   board_autoled_on(LED_HEAPALLOCATE);
   *heap_start = (void *)g_idle_topstack;
-  *heap_size = (uint32_t)&__stack - g_idle_topstack;
+  *heap_size = (uint32_t)__stack - g_idle_topstack;

Review Comment:
   ```suggestion
     *heap_size = __stack - g_idle_topstack;
   ```



##########
arch/arm/src/rtl8720c/ameba_nvic.c:
##########
@@ -316,7 +316,7 @@ void up_irqinitialize(void)
 
   /* Restore the NVIC vector location to local */
 
-  memcpy(&__vectors, (void *) * (volatile uint32_t *)(NVIC_VECTAB)
+  memcpy(__vectors, (void *) * (volatile uint32_t *)(NVIC_VECTAB)

Review Comment:
   seems that `sizeof(__vectors)` is now 0



##########
arch/arm/src/stm32wb/stm32wb_start.c:
##########
@@ -59,7 +59,7 @@
  *               the stack + 4;
  */
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

Review Comment:
   ```suggestion
   #define HEAP_BASE  ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE)
   ```



##########
libs/libc/misc/lib_cxx_initialize.c:
##########
@@ -71,11 +71,11 @@ void lib_cxx_initialize(void)
 #else
       initializer_t *initp;
 
-      sinfo("_sinit: %p _einit: %p\n", &_sinit, &_einit);
+      sinfo("_sinit: %p _einit: %p\n", _sinit, _einit);
 
       /* Visit each entry in the initialization table */
 
-      for (initp = &_sinit; initp != &_einit; initp++)
+      for (initp = _sinit; initp != _einit; initp++)

Review Comment:
   ```suggestion
         for (initp = _sinit; initp < _einit; initp++)
   ```
   should not happen, but just for safety reasons



##########
arch/arm/src/cxd56xx/cxd56_farapi.c:
##########
@@ -106,7 +106,7 @@ struct farmsg_s
  * Public Data
  ****************************************************************************/
 
-extern char _image_modlist_base[];
+extern uint8_t _image_modlist_base[];

Review Comment:
   ```suggestion
   extern struct modulelist_s _image_modlist_base[];
   ```



##########
arch/arm/src/cxd56xx/cxd56_farapi.c:
##########
@@ -230,7 +230,7 @@ void farapi_main(int id, void *arg, struct modulelist_s *mlist)
   api = &msg.u.api;
 
   msg.cpuid      = getreg32(CPU_ID);
-  msg.modid      = mlist - (struct modulelist_s *)&_image_modlist_base;
+  msg.modid      = mlist - (struct modulelist_s *)_image_modlist_base;

Review Comment:
   ```suggestion
     msg.modid      = mlist - _image_modlist_base;
   ```



##########
arch/arm/src/rp2040/rp2040_start.c:
##########
@@ -41,7 +41,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define IDLE_STACK ((uint32_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define IDLE_STACK ((uint32_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

Review Comment:
   ```suggestion
   #define IDLE_STACK ((uint32_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE)
   ```
   maybe even better to
   ```suggestion
   #define IDLE_STACK ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE)
   ```
   since `const uintptr_t g_idle_topstack = IDLE_STACK;`



##########
arch/arm/src/stm32l4/stm32l4_start.c:
##########
@@ -61,7 +61,7 @@
 #define SRAM2_START  STM32L4_SRAM2_BASE
 #define SRAM2_END    (SRAM2_START + STM32L4_SRAM2_SIZE)
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

Review Comment:
   ```suggestion
   #define HEAP_BASE  ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE)
   ```



##########
arch/arm/src/stm32h7/stm32_start.c:
##########
@@ -62,7 +62,7 @@
  * 0x2005:ffff - End of internal SRAM and end of heap (a
  */
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

Review Comment:
   ```suggestion
   #define HEAP_BASE  ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE)
   ```



##########
arch/arm/src/tlsr82/tlsr82_start.c:
##########
@@ -84,13 +84,13 @@ void __tc32_start(void)
   tlsr82_clock_init();
 
 #ifdef CONFIG_SCHED_BACKTRACE
-  extern uint32_t _sramcode;
-  extern uint32_t _eramcode;
+  extern uint8_t _sramcode[];
+  extern uint8_t _eramcode[];
   static void *g_code_regions[] =
   {
-    &_stext   , &_etext,
-    &_sramcode, &_eramcode,
-    NULL      , NULL,
+    _stext   , _etext,
+    _sramcode, _eramcode,
+    NULL     , NULL,
   };
 
   extern void up_backtrace_init_code_regions(void **regions);

Review Comment:
   Maybe this ca be moved out of the function?



##########
arch/arm/src/samd2l2/sam_start.c:
##########
@@ -53,7 +53,7 @@
  * 0x2000:ffff - End of SRAM and end of heap (assuming 64KB of SRAM)
  */
 
-#define IDLE_STACK ((uint32_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define IDLE_STACK ((uint32_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

Review Comment:
   ```suggestion
   #define IDLE_STACK ((uint32_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE)
   ```



##########
arch/arm/src/xmc4/xmc4_start.c:
##########
@@ -66,7 +66,7 @@ static inline void xmc4_flash_waitstates(void);
  * 0x2002:ffff - End of internal SRAM and end of heap (a
  */
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

Review Comment:
   ```suggestion
   #define HEAP_BASE  ((uintptr_t)_ebss + CONFIG_IDLETHREAD_STACKSIZE)
   ```



-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/cxd56xx/cxd56_allocateheap.c:
##########
@@ -115,7 +115,7 @@ void up_allocate_heap(void **heap_start, size_t *heap_size)
 
   board_autoled_on(LED_HEAPALLOCATE);
   *heap_start = (void *)g_idle_topstack;
-  *heap_size = (uint32_t)&__stack - g_idle_topstack;
+  *heap_size = (uint32_t)__stack - g_idle_topstack;

Review Comment:
   Can't, since the type is different(uint8_t * v.s. uintptr_t).



-- 
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 #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/samd2l2/sam_start.c:
##########
@@ -53,7 +53,7 @@
  * 0x2000:ffff - End of SRAM and end of heap (assuming 64KB of SRAM)
  */
 
-#define IDLE_STACK ((uint32_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define IDLE_STACK ((uint32_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/stm32wb/stm32wb_start.c:
##########
@@ -59,7 +59,7 @@
  *               the stack + 4;
  */
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/tlsr82/tlsr82_start.c:
##########
@@ -84,13 +84,13 @@ void __tc32_start(void)
   tlsr82_clock_init();
 
 #ifdef CONFIG_SCHED_BACKTRACE
-  extern uint32_t _sramcode;
-  extern uint32_t _eramcode;
+  extern uint8_t _sramcode[];
+  extern uint8_t _eramcode[];
   static void *g_code_regions[] =
   {
-    &_stext   , &_etext,
-    &_sramcode, &_eramcode,
-    NULL      , NULL,
+    _stext   , _etext,
+    _sramcode, _eramcode,
+    NULL     , NULL,
   };
 
   extern void up_backtrace_init_code_regions(void **regions);

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/stm32l4/stm32l4_start.c:
##########
@@ -61,7 +61,7 @@
 #define SRAM2_START  STM32L4_SRAM2_BASE
 #define SRAM2_END    (SRAM2_START + STM32L4_SRAM2_SIZE)
 
-#define HEAP_BASE  ((uintptr_t)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define HEAP_BASE  ((uintptr_t)_ebss+CONFIG_IDLETHREAD_STACKSIZE)

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 commented on a diff in pull request #7160: arch: Change the linker generated symbols from uint32_t to uint8_t *

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


##########
arch/arm/src/common/arm_internal.h:
##########
@@ -106,17 +106,17 @@
 #  define _START_DATA  __sfb(".data")
 #  define _END_DATA    __sfe(".data")
 #else
-#  define _START_TEXT  &_stext

Review Comment:
   Any code which use link symbols directly without these macros isn't compatible with IAR, but it isn't a problem introduced by this patch, the origin code base is always broken:(.



-- 
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