Re: [Tinycc-devel] 答复: 答复: how to make symbol '_SymLoadModuleEx@36' match its defination of 8 argv

2014-04-06 Thread grischka

lifenjoi...@163.com wrote:

As dbghelp.chm says:
DWORD64 WINAPI SymLoadModuleEx(
  __in  HANDLE hProcess,
  __in  HANDLE hFile,
  __in  PCTSTR ImageName,
  __in  PCTSTR ModuleName,
  __in  DWORD64 BaseOfDll,
  __in  DWORD DllSize,
  __in  PMODLOAD_DATA Data,
  __in  DWORD Flags
);

CPU Disasm
Address   Hex dump  Command
Comments
00401356  |.  B9    MOV ECX,0
0040135B  |.  51PUSH ECX ; /Arg9
= 0
0040135C  |.  B9    MOV ECX,0; |
00401361  |.  51PUSH ECX ; |Arg8
= 0
00401362  |.  8B8D D4FD MOV ECX,DWORD PTR SS:[LOCAL.139] ; |
00401368  |.  51PUSH ECX ; |Arg7
= [LOCAL.139]
00401369  |.  8985 D0FD MOV DWORD PTR SS:[LOCAL.140],EAX ; |
0040136F  |.  8B8D F0FE MOV ECX,DWORD PTR SS:[LOCAL.68]  ; |
00401375  |.  8B85 F4FE MOV EAX,DWORD PTR SS:[LOCAL.67]  ; |
0040137B  |.  50PUSH EAX ; |Arg6
= [LOCAL.67]
0040137C  |.  51PUSH ECX ; |Arg5
= [LOCAL.68]
0040137D  |.  B8    MOV EAX,0; |
00401382  |.  50PUSH EAX ; |Arg4
= 0
00401383  |.  8B85 D0FD MOV EAX,DWORD PTR SS:[LOCAL.140] ; |
00401389  |.  8B00  MOV EAX,DWORD PTR DS:[EAX]   ; |
0040138B  |.  50PUSH EAX ; |Arg3
0040138C  |.  B8    MOV EAX,0; |
00401391  |.  50PUSH EAX ; |Arg2
= 0
00401392  |.  8B45 FC   MOV EAX,DWORD PTR SS:[LOCAL.1]   ; |
00401395  |.  50PUSH EAX ; |Arg1
= [LOCAL.1]
00401396  |.  E8 CD02   CALL JMP.dbghelp.SymLoadModuleEx  ;
\dbghelp.SymLoadModuleEx
0040139B  |.  8985 E8FE MOV DWORD PTR SS:[LOCAL.70],EAX
004013A1  |.  8995 ECFE MOV DWORD PTR SS:[LOCAL.69],EDX


Can any body help?


This does not look wrong but if below
CALL JMP.dbghelp.SymLoadModuleEx
you see
add ESP, ...
then SymLoadModuleEx was not declared (it is not in tinycc headers).

See also
http://repo.or.cz/w/tinycc.git/commitdiff/0e43f3aef401f87030a540646f061b025a5a130b

--- gr.


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] x86_64: shared libs

2014-04-06 Thread grischka

Michael Matz wrote:

Hi,

On Fri, 4 Apr 2014, Michael Matz wrote:

Yes, that's something on my TODO.  Theoretically having 
runtime_plt_and_got makes code emission a tiny bit faster because 
having a proper PLT and GOT also for -run means first creating and 
second applying intermediate relocations (the _GLOB_DAT and _JUMP_SLOT 
relocs), which is cut short with the hack.  OTOH removing the hack 
would remove deviation depending on output type, so I think it's a 
good idea nevertheless.


Done now.  


Wow, does that look clean.  Thanks !

--- grischka

For x86_64 and ARM, where the latter required me to extend 
the current relocation support to some more cases.  To test the latter I 
used gawk and mpfr, for which I had to add alloca support to ARM.  So 
I'm reasonably sure that my changes don't cause regressions, but from 
reading the code there's still potential to fix more things (and of 
course to implement ARM shared libs).  One of those days ...



Ciao,
Michael.



___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Is this ok on commit Use proper PLT/GOT for -run

2014-04-06 Thread Domingo Alvarez Duarte
Hello !

When applying this commit to my fork, I'm not sure if it's correct:



 arm: Use proper PLT/GOT for
-run.http://repo.or.cz/w/tinycc.git/commit/01c041923474750a236da02561f0f8835445848bhttp://repo.or.cz/w/tinycc.git/commit/01c041923474750a236da02561f0f8835445848b
[tinycc.git]http://repo.or.cz/w/tinycc.git/tree/01c041923474750a236da02561f0f8835445848b/
tcc.hhttp://repo.or.cz/w/tinycc.git/blob_plain/01c041923474750a236da02561f0f8835445848b:/tcc.h
  diff --git 
a/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h
b/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h
 index 
76f25bdhttp://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h
..5033b19http://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h100644(file)
 --- 
a/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h
+++ 
b/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h
@@ 
-712,7http://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h#l712
+712,7http://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h#l712@@
 struct TCCState {
 void *write_mem;
 unsigned long mem_size;
 # endif
-# if !defined TCC_TARGET_PE  (defined TCC_TARGET_ARM)
+# if !defined TCC_TARGET_PE  (0)  is this correct
?
 /* write PLT and GOT here */
 char *runtime_plt_and_got;
 unsigned runtime_plt_and_got_offset;
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Is this ok on commit Use proper PLT/GOT for -run

2014-04-06 Thread Domingo Alvarez Duarte
Ok I can see in the next commit that this is removed completely !


On Sun, Apr 6, 2014 at 11:19 AM, Domingo Alvarez Duarte
mingo...@gmail.comwrote:

 Hello !

 When applying this commit to my fork, I'm not sure if it's correct:

 

  arm: Use proper PLT/GOT for 
 -run.http://repo.or.cz/w/tinycc.git/commit/01c041923474750a236da02561f0f8835445848bhttp://repo.or.cz/w/tinycc.git/commit/01c041923474750a236da02561f0f8835445848b
 [tinycc.git]http://repo.or.cz/w/tinycc.git/tree/01c041923474750a236da02561f0f8835445848b/
 tcc.hhttp://repo.or.cz/w/tinycc.git/blob_plain/01c041923474750a236da02561f0f8835445848b:/tcc.h
   diff --git 
 a/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h
 b/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h
  index 
 76f25bdhttp://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h
 ..5033b19http://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h100644(file)
  --- 
 a/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h
 +++ 
 b/tcc.hhttp://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h
 @@ 
 -712,7http://repo.or.cz/w/tinycc.git/blob/76f25bd5e7950f470b3d7bcafa8a0dc467a0ed9d:/tcc.h#l712
 +712,7http://repo.or.cz/w/tinycc.git/blob/5033b19bd6a285df2988843fe03c99b479dafc9e:/tcc.h#l712@@
  struct TCCState {
  void *write_mem;
  unsigned long mem_size;
  # endif
 -# if !defined TCC_TARGET_PE  (defined TCC_TARGET_ARM)
 +# if !defined TCC_TARGET_PE  (0)  is this correct
 ?
  /* write PLT and GOT here */
  char *runtime_plt_and_got;
  unsigned runtime_plt_and_got_offset;

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Is this ok on commit Use proper PLT/GOT for -run

2014-04-06 Thread Michael Matz

Hi,

On Sun, 6 Apr 2014, Domingo Alvarez Duarte wrote:


Ok I can see in the next commit that this is removed completely !


Yep, I was trying to separate cleanups from implementing features also for 
the commits, makes bisecting a tad easier.  (And of course removing chunks 
of dead code without much else just feels wonderful :) ).



Ciao,
Michael.

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Is this ok on commit Use proper PLT/GOT for -run

2014-04-06 Thread Domingo Alvarez Duarte
On win32 with mingw64 I'm getting this error:
-
gcc -o i386-win32/tiny_libmaker.exe ../win32/tools/tiny_libmaker.c -I..
 -Wall -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
-Wno-unused-result -fPIC -DTCC_TARGET_I386 -DTCC_TARGET_PE
../win32/tools/tiny_libmaker.c:1:0: warning: -fPIC ignored for target (all
code is position independent) [enabled by default]
 /*
 ^
i386-win32/tiny_libmaker.exe rcs ../libtcc1.a i386-win32/libtcc1.o
i386-win32/alloca86.o i386-win32/alloca86-bt.o i386-win32/bcheck.o
i386-win32/crt1.o i386-win32/wincrt1.o i386-win32/dllcrt1.o
i386-win32/dllmain.o i386-win32/chkstk.o
Unsupported Elf Class: i386-win32/alloca86.o
Makefile:103: recipe for target `../libtcc1.a' failed
make[1]: *** [../libtcc1.a] Error 2
make[1]: Leaving directory `/home/IEUser/dev/tinycc/lib'
Makefile:229: recipe for target `libtcc1.a' failed


On Sun, Apr 6, 2014 at 11:50 AM, Michael Matz matz@frakked.de wrote:

 Hi,


 On Sun, 6 Apr 2014, Domingo Alvarez Duarte wrote:

  Ok I can see in the next commit that this is removed completely !


 Yep, I was trying to separate cleanups from implementing features also for
 the commits, makes bisecting a tad easier.  (And of course removing chunks
 of dead code without much else just feels wonderful :) ).


 Ciao,
 Michael.

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel