Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Feb 2015 14:36:53 +0100
From:      Eivind Evensen <eivinde@terraplane.org>
To:        freebsd-stable@freebsd.org
Subject:   Buserror when built on FreeBSD 10, not on FreeBSD 8
Message-ID:  <20150205133653.GA16112@klump.hjerdalen.lokalnett>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150205133653.GA16112>