[pcre-dev] [Bug 1274] New: Cross compiling MIPS64, error re…

Top Page
Delete this message
Author: Kirby Kuehl
Date:  
To: pcre-dev
New-Topics: [pcre-dev] [Bug 1274] Cross compiling MIPS64, error relocation truncated to fit: R_MIPS_GOT_PAGE while linking libpcre.a
Subject: [pcre-dev] [Bug 1274] New: Cross compiling MIPS64, error relocation truncated to fit: R_MIPS_GOT_PAGE while linking libpcre.a
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1274
           Summary: Cross compiling MIPS64, error relocation truncated to
                    fit: R_MIPS_GOT_PAGE while linking libpcre.a
           Product: PCRE
           Version: 8.31
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Code
        AssignedTo: ph10@???
        ReportedBy: kkuehl@???
                CC: pcre-dev@???



/usr/lib/cross-tools/mips64-xlr/lib/libpcre.a(pcre_compile.o): In function
`find_error_text':
pcre_compile.c:(.text+0x24): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0x6c): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
/usr/lib/cross-tools/mips64-xlr/lib/libpcre.a(pcre_compile.o): In function
`check_escape':
pcre_compile.c:(.text+0x4e0): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0x534): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0x588): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0x5b4): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0x5e0): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0x60c): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0xd20): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0xd4c): relocation truncated to fit: R_MIPS_GOT_PAGE
against `no symbol'
pcre_compile.c:(.text+0xef4): additional relocation overflows omitted from the
output
make[1]: *** [rmios_app_pass1] Error 1


Several documents point to adding -mxgot to CFLAGS

http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/MIPS-Options.html

-mxgot
-mno-xgot
Lift (do not lift) the usual restrictions on the size of the global offset
table.
GCC normally uses a single instruction to load values from the GOT. While this
is relatively efficient, it will only work if the GOT is smaller than about
64k. Anything larger will cause the linker to report an error such as:


          relocation truncated to fit: R_MIPS_GOT16 foobar


If this happens, you should recompile your code with -mxgot. It should then
work with very large GOTs, although it will also be less efficient, since it
will take three instructions to fetch the value of a global symbol.

Note that some linkers can create multiple GOTs. If you have such a linker, you
should only need to use -mxgot when a single object file accesses more than
64k's worth of GOT entries. Very few do.

These options have no effect unless GCC is generating position independent
code.


It should also be noted that libpcre operates properly as a static library.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email