glibc/ports/sysdeps/tile
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
..
bits Make fenv.h FE_* macros usable in #if (bug 3439). 2012-11-03 17:07:56 +00:00
nptl Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
tilegx tile: support very large shared objects 2012-11-06 09:48:49 -05:00
tilepro Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
__longjmp.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
__tls_get_addr.S tile: BZ#14237: fix __tls_get_addr bug initializing new modules 2012-09-06 11:25:04 -04:00
_mcount.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
abort-instr.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
backtrace.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
bsd-_setjmp.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
bsd-setjmp.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
bzero.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
crti.S tile: support very large shared objects 2012-11-06 09:48:49 -05:00
crtn.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
dl-lookupcfg.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
dl-machine.h Invoke DL_AFTER_LOAD if defined 2012-10-30 14:16:18 -04:00
dl-runtime.c tile: improve simulator notification for relative paths in dlopen 2012-11-06 09:24:44 -05:00
dl-start.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
dl-tls.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
dl-tls.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
dl-trampoline.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
fegetenv.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
fegetround.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
feholdexcpt.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
fesetenv.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
fesetround.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
feupdateenv.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
ffs.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
ffsll.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
gccframe.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
Implies Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
jmpbuf-offsets.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
jmpbuf-unwind.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
ldsodefs.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
libm-test-ulps tile: Account for new tests (missed test-double changes) 2012-11-03 08:46:09 -04:00
machine-gmon.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
Makefile Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
math_private.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
memcopy.h Optimize tile (mostly tilegx) memcpy and memmove performance. 2012-11-06 09:24:19 -05:00
preconfigure Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
s_fma.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
s_fmaf.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
setjmp.S Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
shlib-versions Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
sotruss-lib.c Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
stackguard-macros.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
stackinfo.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
start.S tile: support very large shared objects 2012-11-06 09:48:49 -05:00
sysdep.h tile: fix two comments that said "tile" to properly say "tilepro" 2012-09-24 16:03:33 -04:00
tls-macros.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
tst-audit.h Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
Versions Move all files into ports/ subdirectory in preparation for merge with glibc 2012-07-01 13:06:41 +00:00
wordcopy.c Optimize tile (mostly tilegx) memcpy and memmove performance. 2012-11-06 09:24:19 -05:00