This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ppc64 and @tocbase


Hello,

I tried to build a bi-arch powerpc GCC for RTEMS via this patch:

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 75807f5..b72afd1 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -2367,7 +2367,7 @@ powerpc-*-eabi*)
        use_gcc_stdint=wrap
        ;;
 powerpc-*-rtems*)
- tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h" + tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h newlib-stdint.h rs6000/biarch64.h rs6000/sysv4.h rs6000/eabi.h rs6000/e500.h rs6000/rtems.h rtems.h"
        extra_options="${extra_options} rs6000/sysv4.opt"
tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
        ;;

Now I am able to generate 64-bit code with GCC, but I get an assembler error:

powerpc-rtems4.12-gcc -m64 -O2 -c test.c -save-temps ; cat test.s
test.s: Assembler messages:
test.s:9: Error: junk at end of line, first unrecognized character is `@'
test.s:14: Error: symbol `f' is already defined
test.s: Error: .size expression for f does not evaluate to a constant
        .file   "test.c"
        .machine ppc64
        .section        ".text"
        .align 2
        .globl f
        .section        ".opd","aw"
        .align 3
f:
        .quad   f,.TOC.@tocbase,0
        .previous
        .size   f,24
        .type   .f,@function
        .globl  .f
f:
        addi 3,3,1
        blr
        .size   f, .-f
        .ident  "GCC: (GNU) 6.0.0 20150921 (experimental)

We have

powerpc-rtems4.12-gcc -m64 -O2 -c test.c -wrapper echo
/opt/rtems-4.12/lib/gcc/powerpc-rtems4.12/6.0.0/cc1 -quiet -Dmpc750 test.c -quiet -dumpbase test.c -m64 -auxbase test -O2 -o /tmp/ccQdC93d.s /opt/rtems-4.12/lib64/gcc/powerpc-rtems4.12/6.0.0/../../../../powerpc-rtems4.12/bin/as -mppc -many -mbig -o test.o /tmp/ccQdC93d.s

I tried to figure out the right assembler options by hand without success. For example I get:

/opt/rtems-4.12/lib64/gcc/powerpc-rtems4.12/6.0.0/../../../../powerpc-rtems4.12/bin/as -many -mbig -o test.o test.s -a64
test.s: Assembler messages:
test.s:14: Error: symbol `f' is already defined
test.s: Error: .size expression for f does not evaluate to a constant

Is this more likely a problem with the Binutils configuration or the GCC configuration?

--
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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]