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
0 answers

Linker ignores options from g++

I'm trying to create object file without @-suffix with g++: g++ -Wl,--add-stdcall-alias -c test.cpp or g++ -Wl,--kill-at -c test.cpp But none of options works. Using: MinGW32 with g++ v4.4, ld v2.19.1 Thanks!
Sas
  • 513
  • 3
  • 18
1
vote
1 answer

ld linker's output executable is bigger than the golink output executable, why?

I've assembled a simple code with nasm and linked output obj file with both ld and golink The issue is golink output executable is 2kb of size but ld output executable is 85kb of size I'm using mingw32 and both are using the library kernel32.dll.…
Dan Jay
  • 816
  • 10
  • 25
1
vote
3 answers

Linker Script: Put a particular file at a later position

I'd like to write a linker script looking something like this: SECTIONS { . = 0x0; .startup . : { startup.o(.text) } .text : { *(.text) } .data : { *(.data) } .bss : { *(.bss COMMON) } . = 0x4000; other.text : { other.o(.text) } …
Brendan
  • 1,505
  • 14
  • 29
1
vote
0 answers

Duplicate name/signature linking issue with OpenSSL library

When I build my executable, I'm running into an issue where I have an object file that has a symbol with the same name/signature as one of the OpenSSL functions in libcrypto (SHA_Update). I guess I have two issues here: 1.) I'm surprised that the…
nigp4w rudy
  • 525
  • 1
  • 5
  • 9
1
vote
2 answers

how can i solve ldconfig create link with version number

Suppose I have /a/lib/dir that has files -rwxrwxr-x libboost_signals.so -rwxrwxr-x libboost_signals.so.1.55.0 And I create a file: /etc/ld.so.conf.d/testlib.conf with content /a/lib/dir And run sudo ldconfig sudo ldconfig -v |…
Aylwyn Lake
  • 1,501
  • 3
  • 17
  • 34
1
vote
1 answer

ld : 0711-317 error : Undefined symbol: .kget_proc_info

I am writing a kernel extension in AIX 6.1. I use the "kget_proc_info()" for getting info of a process. But there is a error when I make it: 1>ld : 0711-317 error : Undefined symbol: .kget_proc_info And I use command "nm" to check this symbol: #nm…
edsionte
  • 53
  • 9
1
vote
0 answers

Linker searches for file in /usr/lib when it should do in /usr/lib64

Trying to link, I get this error: /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../libmqic.so when searching for -lmqic /usr/bin/ld: skipping incompatible /usr/lib/libmqic.so when searching for -lmqic /usr/bin/ld:…
1
vote
4 answers

Xcode linker error writing Objective-C

A friend of mine asked me to re-write Box2D in objective-c as much as possible. I started writing and when I build the project so far I got, I got some linker errors, I faced similar problem from before, but it didn't help. The error I get is: Ld…
hakuna matata
  • 2,831
  • 11
  • 46
  • 85
1
vote
2 answers

How does the linker determine at which line a symbol is called?

I want to know, how the linker determines that printf is called @ 0xd1: If I look into the symbol table for the address of _printf I see it's 0x0, because this function is not already relocated. But how does the linker and objdump know that at…
Sebi2020
  • 1,397
  • 14
  • 31
1
vote
2 answers

Mono 'asmonly' option

I created a simple mono executable using MonoDevelop that prints "hello world". I wanted to try the AOT 'asmonly' option. So: [root@localhost Debug]# ls abc.exe [root@localhost Debug]# mono --aot=full,static,asmonly abc.exe Mono Ahead of Time…
Alon Gubkin
  • 53,054
  • 52
  • 181
  • 282
1
vote
1 answer

reference error in mysqlpp

as many others I have got the problem to compile a program including mysqlpp. mysqlpp seems to be installed correctly, the library paths are set correctly in /etc/ld.so.conf also and are known (so I think): $ sudo ldconfig -p | grep…
Sprotti
  • 13
  • 2
1
vote
1 answer

Linker assigns improper LMA to a section (using AT>)

I have a simple asm file with 3 sections: .code 32 .section sec1 MOV R3, #10 .section sec2 MOV R1, #10 .section sec3 MOV R2, #10 .end And a linker script: MEMORY { ram : ORIGIN = 0x00200000, LENGTH = 1K rom : ORIGIN =…
Bart
  • 390
  • 2
  • 15
1
vote
1 answer

libuuid don't link on Ubuntu 12.04

I'm trying to build VHDTool on Ubuntu 12.04 but it's failing when linking: gcc -O2 -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -g2 -c -o vhdtool.o vhdtool.c gcc -luuid vhdtool.o -o vhdtool vhdtool.o: In function…
siete
  • 13
  • 5
1
vote
1 answer

Why ld can't find lboost_regex?

I'm trying to compile GNU Source highlight in my home directory. I configured with a prefix and --with-boost=/path/to/boost/root/dir/ and no errors were reported. But when I try to build I got the following error: $ make ... # lots of…
RSFalcon7
  • 1,981
  • 3
  • 31
  • 52
1
vote
2 answers

How to hide symbol names in executable (from asm code)

I have a small "hello world" program in asm. After compiling and linking, I can see all the names I used for my variables and labels in the final elf file (opened with text editor). Why ? Shouldn't variables and so on be replaced by static or…
Thomas
  • 6,610
  • 7
  • 40
  • 79
1 2 3
99
100