File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,29 @@ Note that all `-mtune` values for ARC-V assume that fast unaligned access is sup
197197(` __riscv_misaligned_fast == 1 ` ) by targets. This assumption may be overwritten by
198198` -mstrict-align `  when building an application or toolchain libraries itself.
199199
200+ ## Using a linker script optimized for performance  
201+ 
202+ The default Picolibc linker script places ` .rodata `  section right after code
203+ sections. However, this approach may lead to decrease in performance since
204+ addressing through a global pointer may not be available for ` .rodata `  in this
205+ case.
206+ 
207+ If safety of read only regions is not a priority in a particular case,
208+ ` picolibc_perf.ld `  linker script may be used to increase performance:
209+ 
210+ ``` 
211+ $ riscv64-snps-elf-gcc \ 
212+  -march=rv32imafc \ 
213+  -mabi=ilp32f \ 
214+  -mtune=arc-v-rhx-100-series \ 
215+  -specs=picolibc.specs \ 
216+  -T picolibc_perf.ld \ 
217+  --crt0=semihost \ 
218+  --oslib=semihost \ 
219+  example.c -o example.elf 
220+ ``` 
221+ 
222+ This linker script places ` .rodata `  in a data region.
200223
201224## Migrating from Newlib  
202225
                         You can’t perform that action at this time. 
           
                  
0 commit comments