Mail Archives: djgpp/1995/09/09/22:01:15
> I have just downloaded V2beta3. All seems fine except that one of my
> programs won't link: undefined reference to ' brk'. Linked ok under
> v1. Anyone have any suggestions as to what's wrong, please?
I added it back in. Just do "#define brk __brk" and it should work
fine for now.
Background: brk is neither posix nor ansi, so the name must be in the
reserved namespace, since it's used in crt0.o. V2 has <libc/stubs.h>
which defines functions that are in the reserved space, but often used
in the user space (like brk() -> __brk()). This causes libc to
include stub definitions for them, like this (but as a single
assembler `jmp' opcode):
brk(x)
{
return __brk(x);
}
brk was missing from <libc/stubs.h>, so libc built OK but applications
would have problems. I added the line to <libc/stubs.h>.
DJ
- Raw text -