Thread: Relocation truncated to fit: R_X86_64_PC32 against symbol defined in COMMON

  1. #1
    Registered User
    Join Date
    Nov 2011
    Location
    Buea, Cameroon
    Posts
    197

    Lightbulb Relocation truncated to fit: R_X86_64_PC32 against symbol defined in COMMON

    Hello +Guys,

    I have this very strange error in C. I need a very large array to store items from file so as to mine, while generating a large tree and do some data mining. I'm working on some Association rule mining algorithms(The FP Growth Algorithm). Here is the error:
    Code:
    [localhost@localhost apriori_1]$ make
    gcc -g -o fptree fpmain.c fptree.c
    /tmp/ccl29X0b.o: In function `main':
    /home/localhost/Documents/Code/apriori_1/fpmain.c:14:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `num_updates' defined in COMMON section in /tmp/ccl29X0b.o
    /home/localhost/Documents/Code/apriori_1/fpmain.c:14:(.text+0x1c): relocation truncated to fit: R_X86_64_PC32 against symbol `num_oflines' defined in COMMON section in /tmp/ccl29X0b.o
    /home/localhost/Documents/Code/apriori_1/fpmain.c:14:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `num_oflines' defined in COMMON section in /tmp/ccl29X0b.o
    /tmp/cc9G8ONd.o: In function `create_fptree':
    /home/localhost/Documents/Code/apriori_1/fptree.c:63:(.text+0x1f6): relocation truncated to fit: R_X86_64_PC32 against symbol `num_oflines' defined in COMMON section in /tmp/ccl29X0b.o
    /tmp/cc9G8ONd.o: In function `add_to_fptree1':
    /home/localhost/Documents/Code/apriori_1/fptree.c:81:(.text+0x2e9): relocation truncated to fit: R_X86_64_PC32 against symbol `num_updates' defined in COMMON section in /tmp/ccl29X0b.o
    /home/localhost/Documents/Code/apriori_1/fptree.c:81:(.text+0x2f4): relocation truncated to fit: R_X86_64_PC32 against symbol `num_updates' defined in COMMON section in /tmp/ccl29X0b.o
    /tmp/cc9G8ONd.o: In function `gensup_headtable':
    /home/localhost/Documents/Code/apriori_1/fptree.c:184:(.text+0x7e6): relocation truncated to fit: R_X86_64_PC32 against symbol `num_updates' defined in COMMON section in /tmp/ccl29X0b.o
    /home/localhost/Documents/Code/apriori_1/fptree.c:184:(.text+0x7f1): relocation truncated to fit: R_X86_64_PC32 against symbol `num_updates' defined in COMMON section in /tmp/ccl29X0b.o
    /tmp/cc9G8ONd.o: In function `get_ancestor':
    /home/localhost/Documents/Code/apriori_1/fptree.c:212:(.text+0x89f): relocation truncated to fit: R_X86_64_32S against symbol `itemset' defined in COMMON section in /tmp/ccl29X0b.o
    /tmp/cc9G8ONd.o: In function `count_fpgsingles':
    /home/localhost/Documents/Code/apriori_1/fptree.c:257:(.text+0xa6f): relocation truncated to fit: R_X86_64_PC32 against symbol `num_updates' defined in COMMON section in /tmp/ccl29X0b.o
    /home/localhost/Documents/Code/apriori_1/fptree.c:257:(.text+0xa7a): additional relocation overflows omitted from the output
    collect2: error: ld returned 1 exit status
    makefile:5: recipe for target 'all' failed
    make: *** [all] Error 1
    [localhost@localhost apriori_1]$
    Any ideas on how to fix this? I don't seem to find much on stackoverflow.

    Cheers!

  2. #2
    Registered User
    Join Date
    Feb 2012
    Posts
    347
    I am not sure but if possible try reducing the array size.

  3. #3
    Registered User
    Join Date
    Nov 2011
    Location
    Buea, Cameroon
    Posts
    197
    Quote Originally Posted by Satya View Post
    I am not sure but if possible try reducing the array size.
    I can't reduce the array size, because I need to read a transaction database and store to this array, then generate a tree so as to mine the data. I just checked some posts online and it appears this is a common problem with linux x86_64 systems[dont' really know if it's the same issue on Mac OS, Windows etc... will verify to be sure] since the sum of all statically allocated data (including COMMON) + code cannot be >2GB. The solution is to use the -mcmodel option with gcc which enables the dynamic allocation of memory.

    so
    Code:
    gcc -g -mcmodel=medium -o out program_files.c
    did the trick :-)

    Thanks,
    Nyah

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. LNK1005: symbol already defined (DLL import)
    By Rhodarus in forum C++ Programming
    Replies: 1
    Last Post: 01-12-2011, 08:42 AM
  2. Unresolved external symbol on used defined namespace
    By Quasar in forum C++ Programming
    Replies: 4
    Last Post: 04-29-2009, 04:11 PM
  3. warning LNK4049: locally defined symbol Func() imported
    By cpjust in forum C++ Programming
    Replies: 9
    Last Post: 01-17-2008, 06:19 PM
  4. More relocation stuff
    By willkoh in forum Windows Programming
    Replies: 1
    Last Post: 04-15-2005, 07:50 AM
  5. Relocation in .obj -files
    By willkoh in forum C++ Programming
    Replies: 6
    Last Post: 04-06-2005, 01:59 PM