tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] tcc generated exe failed to work if it's linked with


From: Jin Qian
Subject: Re: [Tinycc-devel] tcc generated exe failed to work if it's linked with gcc generated object file
Date: Mon, 11 Jul 2016 04:17:27 +0000 (UTC)

Changed the two source files a little bit and rerun the above procedure.  Now I 

c:\tcc> te2.exe
   567in dummy!!!

Note that it cut off 4 bytes from the string "1234567in dummy!!!\n".  Wonder if someone here could tell me why.

Thanks
Jin


========file te1.c===========
#include <stdio.h>

void dummy () {
printf1("1234567in dummy!!!\n");
}
========file te2.c===========
#include <stdio.h>

void printf1(char *p) {
printf("%s\n",p);
}
extern void dummy();
int main(int argc, char *argv[]) {
dummy();
return 0;
}


On Sunday, July 10, 2016 10:37 PM, Jin Qian <address@hidden> wrote:


I am trying to compile a source with tcc against a gcc-generated .o file, but it kept failing. The gcc is from MinGW 64 bit.

More specifically,  I have the following two files (te1.c  te2.c).  I did the following commands on windows7 box

c:\tcc> gcc -c te1.c
c:\tcc> objcopy -O  elf64-x86-64 te1.o
c:\tcc> tcc te2.c te1.o
   (it produced te2.exe, when I ran it, windows OS generates an error saying "te2.exe has stopped working")

Any ideas?

Thanks!

========file te1.c=============
#include <stdio.h>

void dummy () {
printf("in dummy()\n");
}

========file te2.c===================
#include <stdio.h>

extern void dummy();
int main(int argc, char *argv[]) {
dummy();
return 0;
}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]