one more section shall be modified, or be error when srodata section size
is not 4-bytes alignment.

------------------------------------
  .srodata        :
  {
    PROVIDE( _gp = . + 0x800 );
    PROVIDE( __global_pointer$ = _gp);
    *(.srodata.cst16)
    *(.srodata.cst8)
    *(.srodata.cst4)
    *(.srodata.cst2)
    *(.srodata .srodata.*)
    . = ALIGN(4);           --------------------------add this line
  } >dtcm AT>itcm
-----------------------------------

Marko Kiiskila <mkiisk...@yahoo.com.invalid> 於 2022年8月25日 週四 凌晨12:02寫道:

> There was no attached file, I assume that would’ve had
> the error you are seeing.
>
> Regardless, what you have there is a reasonable way
> to get .data padded to 8 byte alignment. Linker script is
> the right place to make that happen.
>
> > On 24. Aug 2022, at 18.08, 范姜徐霖 <jackfa...@gmail.com> wrote:
> >
> > I try to port ble_app program to my board from bsp/hifive1.
> > I found something wrong at srodata alignment. (see attached file)
> > the .data section size is 0x94, and the following .srodata section is
> alignment at 2**3
> > so .sordata section start at 0x98. 4-bytes are skipped.
> > we do not always have this error, it depends.
> > I guess it happen at ".data section size is not 8-byte alignment"
> >
> > I modify the hifive1.ld to make sure .data section size is 8-byte
> alignment.
> > ----------------------
> >   .data          :
> >   {
> >     *(.data .data.*)
> >     *(.gnu.linkonce.d.*)
> >     . = ALIGN(8);  <------------------------I add this line
> >   } >dtcm AT>itcm
> > --------------------------
> >
> > dont know is there anything missing?
> >
> > Jack
> >
>
>

Reply via email to