Skip to content

undefined reference to _heap_base' and _heap_end' #5

Open
@biggestsonicfan

Description

localhost$ G960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/ I960BASE=~/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools/ ../i386-nbsd1-ctools/bin/gcc960 -o qtrom lib/qtrom_test.ld kx/kx_init.o basefile.o fp.o float.o kx/kx.a qt960/qt.a -lckb -lll -sdlkfjhsdf
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(_create.o): multiple definition of `__thread_ptr (.text)'
basefile.o errno.c:0: (_thread_ptr): first seen here
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(_create.o): multiple definition of `_thread_ptr.lf (.text)'
basefile.o errno.c:0: (_thread_ptr): first seen here
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/crt960.o: undefined reference to `_stackbase'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_base'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_end'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_base'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//lib/libll.a(brk.o): undefined reference to `_heap_end'
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//bin/gld960: Can not perform relocation.
/home/rob/i960-CTOOLS-with-NINDY/i386-nbsd1-ctools//bin/gld960: Fatal error.  Output file: qtrom was not created.

From brk.c of the libll :

/*
 * This routine initializes the curbrk pointer.  This must be done
 * at run-time, not at link-time, because the value of heap_base
 * may change if Position-Independent Data (PID) is used.
 *
 * heap_base is defined in the linker-directive files (*.ld).  As
 * shipped, the .ld files define heap_base relative to the end of
 * the data section.  If you want to have an absolute area for the
 * heap, you can simply change the definition of heap_base in the .ld
 * file.  If you want an absolute heap plus PID, you must also change
 * the references to heap_base and heap_end in this module so that
 * they are not biased by g12 (g12 is the PID base register).
 */

However, in our linker-directive file there are no such definitions. An example of a definition is seen in 7-5 of the i960 Processor Software Utilities User's Guide.

/* Bounds of heap: // The heap may be placed in a separate memory region, if desired. */_heap_size = 0x20000;_heap_base = (_end + 0xf) & ~0xf;_heap_end = _heap_base + _heap_size - 1;

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions