glibc/ports/sysdeps
Chris Metcalf fedff58953 tile: support very large shared objects
With gcc 4.8 tilegx has support for -mcmodel=large, to tolerate very
large shared objects.  This option changes the compiler output to
not include direct jump instructions, which have a range of only
2^30, i.e +/- 512MB.  Instead the compiler marshalls the target PCs
into registers and then uses jump- or call-to-register instructions.

For glibc, the upshot is that we need to arrange for a few functions
to tolerate the possibility of a large range between the PC and
the target.  In particular, the crti.S and start.S code needs
to be able to reach from .init to the PLT, as does gmon-start.c.
The elf-init.c code has the reverse problem, needing to call from
libc_nonshared.a (linked at the end of shared objects) back to the
_init section at the beginning.

No other functions in *_nonshared.a need to be built this way, as
they only call the PLT (or potentially each other), but all of that
code is linked at the very end of the shared object.

We don't build the standard -static archives with this option as the
performance cost is high enough and the use case is rare enough that
it doesn't seem worthwhile.  Instead, we would encourage developers
who need the -static model with huge executables to build a private
copy of glibc and configure it with -mcmodel=large.

Note that libc.so et al don't need any changes; the only changes
are for code that is statically linked into user code built with
-mcmodel=large.

For the assembly code, I just rewrote it so that it unconditionally
uses the large model.  To be able to pass -mcmodel=large to
csu/elf-init.c and csu/gmon-start.c, I need to check to see if the
compiler supports that flag, since gcc 4.7 doesn't; I added the
support by creating a small Makefile fragment that just runs the
compiler to check.
2012-11-06 09:48:49 -05:00
..
alpha Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
am33 Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
arm Fix types of FE_DFL_ENV and FE_NOMASK_ENV (bug 14805). 2012-11-05 13:38:40 +00:00
hppa Fix types of FE_DFL_ENV and FE_NOMASK_ENV (bug 14805). 2012-11-05 13:38:40 +00:00
ia64 Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
m68k Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
mips Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
powerpc Make fma use of Dekker and Knuth algorithms use round-to-nearest (bug 14796). 2012-11-03 19:48:53 +00:00
tile tile: support very large shared objects 2012-11-06 09:48:49 -05:00
unix Define lll_futex_timed_wait_bitset for MIPS. 2012-11-05 22:30:54 +00:00