Questions tagged [ld]

The ld (linker or loader) program combines object files, archive files and (references from) shared libraries, relocates their data and addresses together with symbol references. Linking is usually the final step of compiling a program.

2460 questions
1
vote
1 answer

ruby LoadError for .so file

I'm working with ruby1.8.7 on an embedded platform, and I'm trying to port the ruby sqlite3 gem onto the platform. The underlying sqlite3_native.so makes successfully, and is installed on the target. ldd indicates that all dependencies are met.…
1
vote
0 answers

/usr/bin/ld: cannot find -ltcl8.5.so

I am trying to compile an eggdrop. I get through compile and try "make" but get /usr/bin/ld: cannot find -ltcl8.5.so ---------- Yeah! That's the compiling, now the linking! ---------- Linking eggdrop (standard build). gcc -o ../eggdrop bg.o…
user2873047
  • 21
  • 1
  • 4
1
vote
1 answer

Environment variable to tell autotools to append libraries?

Autotools knows about target_LDFLAGS and target_LDADD. The difference is that LDADD gets added later to the command line than LDFLAGS, and its the right place to put libraries (-lfoo). See also this question. Now, I can set the environment variable…
jdm
  • 8,101
  • 9
  • 46
  • 90
1
vote
1 answer

Is a linux application loaded in the loader's address space?

When ld-linux (Linux's loader) loads an application, it loads its ELF data structures to memory, builds some structures (e.g., GOT), and passes the execution to the entry point of the loaded application. Is the loading of this application's code and…
JC1
  • 519
  • 3
  • 19
1
vote
1 answer

Configuring NSight (Eclipse) and ld

I'm trying to build a project in nsight using the cufft.so library, but the linker (ld) can't find the library file, and I'm stumped. The library is installed as /usr/local/cuda/lib64/libcufft.so In the project properties I have gone to…
user2462730
  • 151
  • 9
1
vote
1 answer

How to force linking of a symbol from a particular library?

When linking an executable on Linux i get an 'undefined reference' error like this: undefined reference to `symbol@SOMELIB_1.0' I do not have a control of 'SOMELIB', but I do have the symbol symbol in one of my own shared libraries. I'm absolutely…
sirgeorge
  • 5,815
  • 1
  • 24
  • 32
1
vote
2 answers

Building 32 bit GCC from source on 64 bit: linking issue

/usr/bin/ld: i386:x86-64 architecture of input file `build/gengenrtl.o' is incompatible with i386 output /usr/bin/ld: i386:x86-64 architecture of input file `build/errors.o' is incompatible with i386 output /usr/bin/ld: build/gengenrtl.o: file class…
user2485710
  • 8,623
  • 9
  • 48
  • 92
1
vote
1 answer

Gold linker: specify alignment of sections

I want to specify alignment for some sections. For ld 2.20.0 the following approach works: create a linker script containing only the sections that should be aligned, e.g.: SECTIONS { .data ALIGN(0x40): { *(.data) } .text ALIGN(0x40): {…
1
vote
2 answers

GNU linker (ld) generates static relocations in shared library

If I compile the example code at the bottom with arm-elf-gcc init.c -o lib.so -Wl,-shared -nostdlib I get a shared library with some relocations (readelf lib.so -r): 0000032c 00000d02 R_ARM_ABS32 000004b8 plpv1 00000330 00001302…
Thomas Schmid
  • 131
  • 10
1
vote
1 answer

Can't link with shared library

I can't link my program with shared library located in non-standart OSX lib directory. I've got this library from MacPorts and it's located in /opt/local/lib: $ ls /opt/local/lib/libgmp* /opt/local/lib/libgmp.10.dylib …
dzhioev
  • 66
  • 5
  • 17
1
vote
1 answer

Rewrite link table in elf

So we have shared library from a vendor who won't deliver their library in a static archive .a format on Linux or Android (but does on other platforms) because it would be inconvenient for them to change their build process. The issue is that need…
Zac Bowling
  • 6,368
  • 1
  • 24
  • 26
1
vote
1 answer

LD_DEBUG on FreeBSD

In Linux ldd has very useful option LD_DEBUG. LD_DEBUG (glibc since 2.1) Output verbose debugging information about the dynamic linker. If set to all prints all debugging information it has, if set to help prints a help message about which…
andreych
  • 173
  • 6
1
vote
1 answer

Linux linking a shared object

I am linking an so, that depends on libmxml.so. However I have no rights install libmxml.so. So thats what I am doing gcc -shared -m32 -o ServiceProvider.so ServiceProvider.o -L ../../../../system/addonlibs/ -lmxml -lpthread ldd shows me ldd…
Stasik
  • 2,430
  • 1
  • 23
  • 40
1
vote
1 answer

Undefined symbols for architecture x86_64: Mac OS 10.8

So generally, I know what this error means. But here's what's unique to my issue - I do have the (static) library with the symbols the linker is unable to find. I ran the 'nm' to verify this, explicitly looking for the x86_64 symbols. They're…
1
vote
1 answer

GMP with MinGW on Windows

I managed to build the GMP library successfully on my Windows 7 (64-bit computer). The steps I followed were: ./configure --enable_cxx --disable-static --enable-shared --prefix="/c/MinGW" make make install make check All of the tests pass…
Alex Reinking
  • 6,342
  • 2
  • 28
  • 47
1 2 3
99
100