<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinycc/i386-link.c, branch main</title>
<subtitle>Tiny C Compiler by Fabrice Bellard Git mirror of the final release by Bellard, discarding all changes after. The repository at https://repo.or.cz/tinycc.git has become untrustworthy. Also the tcc sources have become tainted with AI slop.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/'/>
<entry>
<title>final update for 0.9.27</title>
<updated>2017-12-12T16:57:20+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2017-12-12T16:57:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=d348a9a51d32cece842b7885d27a411436d7887b'/>
<id>d348a9a51d32cece842b7885d27a411436d7887b</id>
<content type='text'>
tccgen.c:
- fix ldouble asm hack
- fix a VLA problem on Win64 (also x86_64-gen.c)
- patch_type(): make sure that no symbol ever changes
  from global to static

tcc.c:
- tcc -vv: print libtcc1.a path also on win32

tccpe.c, tcctools.c:
- use unix LF mode to for .def output files (that is for
  creating reproducible output trees)

Makefile:
- suppress some warnings when makeinfo is missing
- call 'which install' only on win32

tests/Makefile:
- change PATH only on WINNT systems (i.e. not if cross-compiling
  on linux for win32)
- asm-c-connect.test: slim output and do diff

tccrun.c tccpe.c *-link.c:
- integrate former 'pe_relocate_rva()' into normal relocation
  This also fixes linkage of the unwind data on WIN64 for -run
  (reported by Janus Lynggaard Thorborg)

tccasm.c, tests/tcctest.c:
- fix dot (sym_index of -1 crashed in put_elf_reloc)
- massage .set a bit (see test)

other:
- #define SECTION_ABS removed
- ST_DATA Section *strtab_section: removed
- put_extern_sym2(): take int section number

Conflicts:
	tccelf.c
	tccpe.c

Conflicts:
	tccelf.c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
tccgen.c:
- fix ldouble asm hack
- fix a VLA problem on Win64 (also x86_64-gen.c)
- patch_type(): make sure that no symbol ever changes
  from global to static

tcc.c:
- tcc -vv: print libtcc1.a path also on win32

tccpe.c, tcctools.c:
- use unix LF mode to for .def output files (that is for
  creating reproducible output trees)

Makefile:
- suppress some warnings when makeinfo is missing
- call 'which install' only on win32

tests/Makefile:
- change PATH only on WINNT systems (i.e. not if cross-compiling
  on linux for win32)
- asm-c-connect.test: slim output and do diff

tccrun.c tccpe.c *-link.c:
- integrate former 'pe_relocate_rva()' into normal relocation
  This also fixes linkage of the unwind data on WIN64 for -run
  (reported by Janus Lynggaard Thorborg)

tccasm.c, tests/tcctest.c:
- fix dot (sym_index of -1 crashed in put_elf_reloc)
- massage .set a bit (see test)

other:
- #define SECTION_ABS removed
- ST_DATA Section *strtab_section: removed
- put_extern_sym2(): take int section number

Conflicts:
	tccelf.c
	tccpe.c

Conflicts:
	tccelf.c
</pre>
</div>
</content>
</entry>
<entry>
<title>Spelling fixes in C comments only</title>
<updated>2017-05-08T04:38:09+00:00</updated>
<author>
<name>Larry Doolittle</name>
<email>ldoolitt@recycle.lbl.gov</email>
</author>
<published>2017-05-08T04:38:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=19d8b8a17383863d45823e37f20a94cc1d55c3a6'/>
<id>19d8b8a17383863d45823e37f20a94cc1d55c3a6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>elf: Support STB_LOCAL dynamic symbols</title>
<updated>2017-05-07T02:41:40+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2017-05-07T02:41:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=680e84fe42b66b92d9cbdcf5beffe4957c53b721'/>
<id>680e84fe42b66b92d9cbdcf5beffe4957c53b721</id>
<content type='text'>
local symbols can be resolved statically, they don't have to be
done dynamically, so this is a slight speedup at load time for
produced executables and shared libs.  The musl libc also rejects
any STB_LOCAL symbols for dynamic symbol resolution, so there it
also fixes use of shared libs created by tcc.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
local symbols can be resolved statically, they don't have to be
done dynamically, so this is a slight speedup at load time for
produced executables and shared libs.  The musl libc also rejects
any STB_LOCAL symbols for dynamic symbol resolution, so there it
also fixes use of shared libs created by tcc.
</pre>
</div>
</content>
</entry>
<entry>
<title>tcc: fixup clang warnings</title>
<updated>2017-04-25T10:55:18+00:00</updated>
<author>
<name>Andrei Warkentin</name>
<email>andrey.warkentin@gmail.com</email>
</author>
<published>2017-03-28T06:51:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=63b2f907bd9f8ad82b2cfaf8a34497578877253b'/>
<id>63b2f907bd9f8ad82b2cfaf8a34497578877253b</id>
<content type='text'>
The O(xxx) stuff in i386-asm.c had me scratching my head. Extracting
the macro and trying it out in a separate program doesn't give
me any warnings, so I'm confused about what could be going on there.
Any cast will make things happy. I used a uint64_t to catch actual
cases of overflow, which will still cause a -Wconstant-conversion
warning.

Signed-off-by: Andrei Warkentin &lt;andrey.warkentin@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The O(xxx) stuff in i386-asm.c had me scratching my head. Extracting
the macro and trying it out in a separate program doesn't give
me any warnings, so I'm confused about what could be going on there.
Any cast will make things happy. I used a uint64_t to catch actual
cases of overflow, which will still cause a -Wconstant-conversion
warning.

Signed-off-by: Andrei Warkentin &lt;andrey.warkentin@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix gawk miscompile</title>
<updated>2016-12-18T04:20:14+00:00</updated>
<author>
<name>Michael Matz</name>
<email>matz@suse.de</email>
</author>
<published>2016-12-18T04:18:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=77d7ea04acb56f839031993c102366e30cad5c25'/>
<id>77d7ea04acb56f839031993c102366e30cad5c25</id>
<content type='text'>
See testcase.  Function pointer use was hosed when the destination
function wasn't also called normally by the program.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See testcase.  Function pointer use was hosed when the destination
function wasn't also called normally by the program.
</pre>
</div>
</content>
</entry>
<entry>
<title>tccelf: some linker cleanup</title>
<updated>2016-12-15T16:01:22+00:00</updated>
<author>
<name>grischka</name>
<email>grischka</email>
</author>
<published>2016-12-15T16:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=ca92bfc3c64128872793c167de3a58a78b9a1299'/>
<id>ca92bfc3c64128872793c167de3a58a78b9a1299</id>
<content type='text'>
- generate and use SYM@PLT for plt addresses
- get rid of patch_dynsym_undef hack (no idea what it did on FreeBSD)
- use sym_attrs instead of symtab_to_dynsym
- special case for function pointers into .so on i386
- libtcc_test: test tcc_add_symbol with data object
- move target specicic code to *-link.c files
- add R_XXX_RELATIVE (needed for PE)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- generate and use SYM@PLT for plt addresses
- get rid of patch_dynsym_undef hack (no idea what it did on FreeBSD)
- use sym_attrs instead of symtab_to_dynsym
- special case for function pointers into .so on i386
- libtcc_test: test tcc_add_symbol with data object
- move target specicic code to *-link.c files
- add R_XXX_RELATIVE (needed for PE)
</pre>
</div>
</content>
</entry>
<entry>
<title>Use functions to get relocation info</title>
<updated>2016-12-10T18:14:10+00:00</updated>
<author>
<name>Thomas Preud'homme</name>
<email>robotux@celest.fr</email>
</author>
<published>2016-12-10T17:22:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=fe6453f8f08b5c21a339b3169a837772a9864d62'/>
<id>fe6453f8f08b5c21a339b3169a837772a9864d62</id>
<content type='text'>
MSVC does not support array designator so cannot compile source using
relocs_info. This commit replace the relocs_info array into a set of
functions, each returning the value given by a given field of the struct
reloc_info.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MSVC does not support array designator so cannot compile source using
relocs_info. This commit replace the relocs_info array into a set of
functions, each returning the value given by a given field of the struct
reloc_info.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove now useless pltoff_addend reloc info</title>
<updated>2016-12-10T18:13:23+00:00</updated>
<author>
<name>Thomas Preud'homme</name>
<email>robotux@celest.fr</email>
</author>
<published>2016-12-10T17:18:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=d31226c8738d948e2bb4133b56597fff25169e43'/>
<id>d31226c8738d948e2bb4133b56597fff25169e43</id>
<content type='text'>
Last use for pltoff_addend field of relocs_info array was removed in
commit 25927df3b75c5ce2b64ab8acdcc5974b4e1c89c1. It is now useless so
this commit removes it and all initialization related to it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Last use for pltoff_addend field of relocs_info array was removed in
commit 25927df3b75c5ce2b64ab8acdcc5974b4e1c89c1. It is now useless so
this commit removes it and all initialization related to it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix PLT creation for i386</title>
<updated>2016-12-10T09:44:09+00:00</updated>
<author>
<name>Thomas Preud'homme</name>
<email>robotux@celest.fr</email>
</author>
<published>2016-12-10T09:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=0bf262864c95e555fbd077b8f30e64652d9113a6'/>
<id>0bf262864c95e555fbd077b8f30e64652d9113a6</id>
<content type='text'>
i386 target does not have PC relative loads. Its ABI therefore require
ebx register to points to the GOT when executing a PLT entry. This means
that PLT entry cannot be used transparently, the compiler needs to
expect execution of a PLT entry to be able to use one, that is a PLT
entry should only be created if the relocation explicitely asks for it
(eg. R_386_PLT32).

This patch creates a new target macro PCRELATIVE_DLLPLT to indicate
whether a target can do a PC relative load in PLT entry when building a
dynamic library. Executable do not normally pose a problem because they
are loaded at a fixed address and thus the absolute address of GOT can
be used.

Note that in such a case, if the compiler does not use a PLT aware
relocation for external access then the code relocation will fall on the
dynamic loader since there is no PLT entry to relocate too.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
i386 target does not have PC relative loads. Its ABI therefore require
ebx register to points to the GOT when executing a PLT entry. This means
that PLT entry cannot be used transparently, the compiler needs to
expect execution of a PLT entry to be able to use one, that is a PLT
entry should only be created if the relocation explicitely asks for it
(eg. R_386_PLT32).

This patch creates a new target macro PCRELATIVE_DLLPLT to indicate
whether a target can do a PC relative load in PLT entry when building a
dynamic library. Executable do not normally pose a problem because they
are loaded at a fixed address and thus the absolute address of GOT can
be used.

Note that in such a case, if the compiler does not use a PLT aware
relocation for external access then the code relocation will fall on the
dynamic loader since there is no PLT entry to relocate too.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix relocs_info declaration in tcc.h</title>
<updated>2016-12-05T20:51:10+00:00</updated>
<author>
<name>Thomas Preud'homme</name>
<email>robotux@celest.fr</email>
</author>
<published>2016-12-05T20:40:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.datenwolf.net/tinycc/commit/?id=59391d5520534ef1fe3cc2e96fa567c870e2f533'/>
<id>59391d5520534ef1fe3cc2e96fa567c870e2f533</id>
<content type='text'>
C standard specifies that array should be declared with a non null size
or with * for standard array. Declaration of relocs_info in tcc.h was
not respecting this rule. This commit add a R_NUM macro that maps to the
R_&lt;ARCH&gt;_NUM macros and declare relocs_info using it. This commit also
moves all linker-related macros from &lt;arch&gt;-gen.c files to &lt;arch&gt;-link.c
ones.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
C standard specifies that array should be declared with a non null size
or with * for standard array. Declaration of relocs_info in tcc.h was
not respecting this rule. This commit add a R_NUM macro that maps to the
R_&lt;ARCH&gt;_NUM macros and declare relocs_info using it. This commit also
moves all linker-related macros from &lt;arch&gt;-gen.c files to &lt;arch&gt;-link.c
ones.
</pre>
</div>
</content>
</entry>
</feed>
