How to support 64-bit PowerPC -mcmodel=medium?

Sebastian Huber sebastian.huber@embedded-brains.de
Fri Aug 11 09:33:00 GMT 2017


Hello,

it seems that the -mcmodel=small was not the right default for RTEMS 
applications, since I get

relocation truncated to fit: R_PPC64_TOC16_DS against `.got'+118

errors quite quickly.

So, I try to add the -mcmodel option. However, some piece is missing:

/build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/xgcc 
-B/build/git-build/b-gcc-git-powerpc-rtems4.12/./gcc/ -nostdinc 
-B/build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/me6500/m64/newlib/ 
-isystem 
/build/git-build/b-gcc-git-powerpc-rtems4.12/powerpc-rtems4.12/me6500/m64/newlib/targ-include 
-isystem /home/EB/sebastian_h/archive/gcc-git/newlib/libc/include 
-B/opt/rtems-4.12/powerpc-rtems4.12/bin/ 
-B/opt/rtems-4.12/powerpc-rtems4.12/lib/ -isystem 
/opt/rtems-4.12/powerpc-rtems4.12/include -isystem 
/opt/rtems-4.12/powerpc-rtems4.12/sys-include  -mcpu=e6500 -m64 -g -O2 
-O2 -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall 
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes 
-Wmissing-prototypes -Wold-style-definition  -isystem ./include -I. -I. 
-I../../../.././gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc 
-I/home/EB/sebastian_h/archive/gcc-git/libgcc/. 
-I/home/EB/sebastian_h/archive/gcc-git/libgcc/../gcc 
-I/home/EB/sebastian_h/archive/gcc-git/libgcc/../include   -g0 
-finhibit-size-directive -fno-inline -fno-exceptions 
-fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize 
-fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -I. -I. 
-I../../../.././gcc -I/home/EB/sebastian_h/archive/gcc-git/libgcc 
-I/home/EB/sebastian_h/archive/gcc-git/libgcc/. 
-I/home/EB/sebastian_h/archive/gcc-git/libgcc/../gcc 
-I/home/EB/sebastian_h/archive/gcc-git/libgcc/../include  -o crtbeginS.o 
-MT crtbeginS.o -MD -MP -MF crtbeginS.dep -msdata=none -O2 -c 
/home/EB/sebastian_h/archive/gcc-git/libgcc/crtstuff.c -DCRT_BEGIN 
-DCRTSTUFFS_O -fPIC -mcmodel=medium -save-temps
crtstuff.s: Assembler messages:
crtstuff.s:44: Error: can't resolve `.tm_clone_table' {.tm_clone_table 
section} - `.LCTOC1' {.toc1 section}
crtstuff.s:45: Error: can't resolve `__TMC_END__' {*UND* section} - 
`.LCTOC1' {.toc1 section}
crtstuff.s:82: Error: can't resolve `.tm_clone_table' {.tm_clone_table 
section} - `.LCTOC1' {.toc1 section}
crtstuff.s:83: Error: can't resolve `__TMC_END__' {*UND* section} - 
`.LCTOC1' {.toc1 section}
crtstuff.s:131: Error: can't resolve `.bss' {.bss section} - `.LCTOC1' 
{.toc1 section}
crtstuff.s:143: Error: can't resolve `__dso_handle' {.sdata section} - 
`.LCTOC1' {.toc1 section}
crtstuff.s:149: Error: can't resolve `__DTOR_END__' {*UND* section} - 
`.LCTOC1' {.toc1 section}
crtstuff.s:150: Error: can't resolve `.dtors' {.dtors section} - 
`.LCTOC1' {.toc1 section}
crtstuff.s:153: Error: can't resolve `.bss' {.bss section} - `.LCTOC1' 
{.toc1 section}
crtstuff.s:157: Error: can't resolve `.dtors' {.dtors section} - 
`.LCTOC1' {.toc1 section}
crtstuff.s:162: Error: can't resolve `.bss' {.bss section} - `.LCTOC1' 
{.toc1 section}
crtstuff.s:185: Error: can't resolve `.eh_frame' {.eh_frame section} - 
`.LCTOC1' {.toc1 section}
crtstuff.s:192: Error: can't resolve `.bss' {.bss section} - `.LCTOC1' 
{.toc1 section}
crtstuff.s:226: Error: can't resolve `.bss' {.bss section} - `.LCTOC1' 
{.toc1 section}
crtstuff.s:227: Error: can't resolve `.eh_frame' {.eh_frame section} - 
`.LCTOC1' {.toc1 section}

The code generation works with -mcmodel=small and -mcmodel=large.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PowerPC-RTEMS-Enable-mcmodel-option.patch
Type: text/x-patch
Size: 3311 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20170811/4ed42cf2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crtstuff.s
Type: text/x-asm
Size: 5018 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20170811/4ed42cf2/attachment-0001.bin>


More information about the Gcc mailing list