This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ERROR: underfined symbol=end


HenrySimmons17@aol.com wrote:
> 
> Hello,
> 
> I am compiling an application to run on a Motorola 5206eLITE board with
> uClinux OS. This board does not have  a memory management unit nor a floating
> point unit. When linking the application I get the following :
> 
> ERROR: underfined symbol=end
> I am linking the following libaries:
> 
> newlib/msoft-float/libnosys/libnosys.a
> newlib/msoft-float/libc.a
> newlib/msoft-float/libm.a
> uClinux-coldfire/lib/libc/libc.a
> uClinux-coldfire/tools/gcc-lib/libgcc.a
> 
> How can I resolve this error?
> Thank you for your help,
> 
> Henry

The libnosys version of sbrk expects the "end" symbol to be defined by the linker.
The default linker template sets the value of "end" to be at the end of the bss.  This is chosen to
be the start of the heap.

Currently, PROVIDE(end=.) is found in the default linker template so most platforms
normally get this automatically.  

Check your linker script or specify --verbose to the linker with no files (if you normally
don't have to provide a linker script).  The --verbose option will output the internal linker
script for you which you can save to a file.  If the linker script is not specifying the "end"
symbol, then add the statement,  PROVIDE(end = .); at the end of the bss section.  For example, the
following snippet is taken from the native Linux output of ld --verbose:

  __bss_start = .;
  .sbss      : { *(.sbss) *(.scommon) }
  .bss       :
  {
   *(.dynbss)
   *(.bss)
   *(COMMON)
  }
  . = ALIGN(32 / 8);
  _end = . ;
  PROVIDE (end = .);


Once you have edited the linker script, you can specify the linker to use it via the -T command
when you compile/link (e.g. my-gcc -Tmy.ld hello.c ... )

Alternatively, you can edit the libgloss/libnosys/sbrk.c file and specify a symbol other than
"end" that corresponds to a symbol provided by your linker that you want to be the start of the
heap.

-- Jeff J.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]