Buserror when built on FreeBSD 10, not on FreeBSD 8

Eivind Evensen eivinde at terraplane.org
Thu Feb 5 14:15:20 UTC 2015


Hello.

After upgrading from FreeBSD 8 to 10, I have a problem I don't
understand, hopefully somebody here knows what is happening.

I have a project that uses both assembly and c. I started getting
bus errors after building on FreeBSD 10. I had, and may still have
some objects around from FreeBSD 8 and if I link those, on 10, they work.
I don't have any installations running 8 any longer though.
This is on amd64 platform.

I could reduce the problem to the following files.

makefile:
-----------------------------------------------
ASM ?= yasm

.c.o:
	${CC} -g -c $<

.s.o:
	${ASM} -felf64 -gdwarf2 $<

prgs:	a1 a2

a1:	s.o c1.o
	${CC} -o$@ $>

a2:	s.o c2.o
	${CC} -o$@ $>

clean:
	rm -f a1 a2 s.o c1.o c2.o
-------------------------------------------

s.s:
-------------------------------------------
	global	asmcode
	extern	cagain
asmcode:
	call	cagain
	ret
-------------------------------------------

c1.c:
-------------------------------------------
#include <stdio.h>

void asmcode();
void cagain();

int main()
{	asmcode();
	return(0);
}

void cagain()
{	printf("doesn't work\n");
}
--------------------------------------------

c2.c:
--------------------------------------------
#include <stdio.h>

void asmcode();
void cagain();

int main()
{	asmcode();
	return(0);
}

void cagain()
{	puts("works\n");
}
---------------------------------------------

Basically, coming back to c-code and calling certain functions,
like in this case printf() gives a buserror. Calling puts() on
the other hand works, like can be seen by building the above and
executing those.

Does anybody know what's up?

Regards,
Eivind N Evensen


More information about the freebsd-stable mailing list