TaiJuWu commented on issue #10594: URL: https://github.com/apache/nuttx/issues/10594#issuecomment-1715483431
I find a [post](https://forums.sifive.com/t/link-error-relocation-truncated-to-fit-r-riscv-jal-against-symbol/4163) illustrate this problem and try to follow their step. Original linker script is ``` SECTIONS { . = 0x80000000; .text : { _stext = . ; *(.text) *(.text.*) *(.gnu.warning) *(.stub) *(.glue_7) *(.glue_7t) *(.jcr) /* C++ support: The .init and .fini sections contain specific logic * to manage static constructors and destructors. */ *(.gnu.linkonce.t.*) *(.init) /* Old ABI */ *(.fini) /* Old ABI */ _etext = . ; } .rodata : { _srodata = . ; *(.rodata) *(.rodata1) *(.rodata.*) *(.gnu.linkonce.r*) _erodata = . ; } ..... ``` and their address show ``` 0x000000008000051e __clzdi2 0x0000000080017f20 __clz_tab ``` After I modify linker script to ``` SECTIONS { . = 0x80000000; .text : { _stext = . ; *(.text.*) *(.gnu.warning) *(.stub) *(.glue_7) *(.glue_7t) *(.jcr) *(.text) /* C++ support: The .init and .fini sections contain specific logic * to manage static constructors and destructors. */ *(.gnu.linkonce.t.*) *(.init) /* Old ABI */ *(.fini) /* Old ABI */ _etext = . ; } .rodata : { _srodata = . ; *(.rodata) *(.rodata1) *(.rodata.*) *(.gnu.linkonce.r*) _erodata = . ; } ``` Their address are ``` 0x0000000080017f1e __clzdi2 0x0000000080017f60 __clz_tab ``` But still failed. -- 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]
