Post Go back to editing

GNU tools LDF file warning

I am building using the GNU toolchain for a BF518.  I have a warning message that I do not understand enough to solve.

bfin-elf-ldr.exe: count is not 4 byte aligned (0x11E6 % 4 = 2)

bfin-elf-ldr.exe: going to pad the end with zeros, but you should fix this

It seems that I have not padded a section or something like that.  Can anyone help me understand the issue better so I can resolve it.

Here is the LDF file:

/* GNU Linker File */

/* Created based on the default linker script for single core blackfin standalone executables */

MEMORY

{

  MEM_L1_CODE       : ORIGIN = 0xFFA00000, LENGTH = 0x7FFF

  MEM_L1_CODE_CACHE : ORIGIN = 0xFFA10000, LENGTH = 0x3FFF

  MEM_L1_SCRATCH    : ORIGIN = 0xFFB00000, LENGTH = 0xFFF

  MEM_L1_DATA_B     : ORIGIN = 0xFF900000, LENGTH = 0x7FFF

  MEM_L1_DATA_A     : ORIGIN = 0xFF800000, LENGTH = 0x7FFF

  MEM_SDRAM         : ORIGIN = 0x00000004, LENGTH = 0xFFFFEC

  MEM_L2            : ORIGIN = 0xFEB00000, LENGTH = 0x0

  default           : ORIGIN = 0x00000004, LENGTH = 0xFFFFEC

}

OUTPUT_FORMAT("elf32-bfin", "elf32-bfin", "elf32-bfin")

OUTPUT_ARCH(bfin)

ENTRY(__start)

SECTIONS

{

  /* Read-only sections, merged into text segment: */

  PROVIDE (__executable_start = 0x4); . = 0x4;

 

   .init           :

  {

    KEEP (*(.init))

    *(program interrupts dmaDescriptors)

  } >MEM_L1_CODE =0

 

  .sdram.data :

  {

    . = 0x10000;

    *(.sdram.data TASK_STACKS)

  } >MEM_SDRAM =0

  .l2             :

  {

    *(.l2 .l2.*)

  } >MEM_L2 =0

  .text           :

  {

    *(.text .text.* .l1.text .l1.text.*)

    KEEP (*(.text.*personality*))

    /* .gnu.warning sections are handled specially by elf32.em.  */

    *(.gnu.warning)

  } >MEM_SDRAM =0

  .fini           :

  {

    KEEP (*(.fini))

  } >MEM_L1_CODE =0

  .rodata         :

  {

    *(.rodata .rodata.*)

  } >MEM_SDRAM =0

  .data           :

  {

    *(.data .data.* .l1.data .l1.data.*)

    KEEP (*(.*personality*))

  } >MEM_SDRAM =0

  .bss            :

  {

   __bss_start = .;

    *(.bss .bss.*)

    *(COMMON)

    __bss_end = .;

  } >MEM_SDRAM =0

  . = ALIGN(32 / 8);

  . = ALIGN(32 / 8);

  __end = .; PROVIDE (_end = .);

  __stack_start = ORIGIN(MEM_L1_SCRATCH);

  __stack_end   = ORIGIN(MEM_L1_SCRATCH) + 0x200;

  /DISCARD/ : { *(.note.GNU-stack) }

}

  • Hi,

    I have moved this question from the Blackfin Processors community to the GNU Toolchain for Blackfin community. Please continue the discussion here.

    Regards,

    Craig.

  • Could you provide a bit more info on what you're doing, or ideally provide an example that exhibits this warning?

    For instance, what is the command line you are using with bfin-ldr?   are you punching any holes for forcing a specific block size?

    Stu

  • So it appears that when you have .init and .fini in a section on their own, it leaves an odd sized block (caused by .fini being size 0xE).  This isn't a big issue and you can fix it by padding the end of the .fini section, e.g.:

    .fini           :

      {

        KEEP (*(.fini))

        . = ALIGN(32 / 8);

      } >MEM_L1_CODE =0

    Stu

  • I do not believe I am doing anything out of the ordinary.  Here is the command line.  I have a small init program to initialize the SDRAM controller.  The mh.dxe can then be loaded into SDRAM.  I do not understand what the loader is complaining about.  What is "count"?

    bfin-elf-ldr -T bf518 -c mh.ldr mh.dxe -i init.dxe

    Creating LDR mh.ldr ...

    Adding DXE 'mh.dxe' ... [initcode 216] [jump block to 0x00013C04] [ELF block: 14718452 @ 0x00000004] [ELF block: 4582 @ 0xFFA00000] bfin-elf-ldr.exe: count is not 4 byte aligned (0x11E6 % 4 = 2)

    bfin-elf-ldr.exe: going to pad the end with zeros, but you should fix this

    OK!

    Done!