Questions tagged [binutils]

The GNU binary utilities. A collection of tools for operating on object files. Most notably they include the GNU assembler and linker. They are typically used in conjunction with the GNU compiler collection (GCC).

418 questions
11
votes
1 answer

Unresolvable `R_X86_64_NONE` relocation

I'm using Devtoolset-7 on CentOS 7 and have built Boost 1.65.1 w/ it. But when I link my application, I've got the following: /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld:…
zaufi
  • 6,811
  • 26
  • 34
11
votes
1 answer

How to create stub shared libraries on Linux

Let's first explain what I mean with a stub shared library: a shared library that can be used to link against (w/ a certain interface provided by a real library) but don't contain the actual code (so has no functionality). Along with the header…
wump
  • 4,277
  • 24
  • 25
10
votes
2 answers

objdump and ARM vs Thumb

I'm trying to disassemble an object built for ARM with gcc. Unfortunately, objdump is trying to guess whether the code is ARM and Thumb, and is getting it wrong: it thinks my code is Thumb when it's actually ARM. I see that objdump has an option to…
David Given
  • 13,277
  • 9
  • 76
  • 123
10
votes
2 answers

binutils build fails because of pex-unix file

I want to cross-compile GCC. I am using MSYS2 as a shell, and mingw-w64 as the compiler. I have downloaded binutils-2.25 and I configure with: ../binutils/./configure --target=sh3eb-elf --prefix=C:/tempinstall/ --disable-nls I get an error when I…
Intelligide
  • 279
  • 2
  • 14
10
votes
2 answers

How can the --add-section switch of OBJCOPY be used?

There are really two questions that revolve around the use of --add-section. The simple one is in the title. Based on my reading, I haven't been able to figure out how one could execute --add-section. To use add-section, I have to pass a section…
user2600958
  • 133
  • 1
  • 7
10
votes
2 answers

How to install gnu ld on mac os x 10.6?

I'm having a lot of trouble compiling the otherwise excellent Contiki OS on my macbook pro (with mac os x 10.6). Contiki actually uses a lot of GNU-specific features and options of GCC, AR, LD, and so on. So I installed those utilities via macports,…
Gyom
  • 3,773
  • 5
  • 29
  • 38
9
votes
0 answers

GNU Linker: ELF has a LOAD segment with RWX permissions. Embedded ARM project

I have updated my arm-none-eabi GCC and the associated tools and rebuilt an embedded project I develop. $ arm-none-eabi-ld --version GNU ld (GNU Binutils) 2.39 Suddenly, I'm getting the…
GNA
  • 479
  • 3
  • 18
9
votes
3 answers

Patching code/symbols into a dynamic-linked ELF binary

Suppose I have an ELF binary that's dynamic linked, and I want to override/redirect certain library calls. I know I can do this with LD_PRELOAD, but I want a solution that's permanent in the binary, independent of the environment, and that works for…
R.. GitHub STOP HELPING ICE
  • 208,859
  • 35
  • 376
  • 711
9
votes
1 answer

Weird MIPS assembler behavior with jump (and link) instruction

So, we're studying MIPS architecture at school and we're implementing a MIPS32 architecture. I thought I'd use GNU cross-binutils as assembler but I'm getting weird output when dealing with instructions jal, j and jr. The assembler seems to insert…
Maister
  • 4,978
  • 1
  • 31
  • 34
9
votes
1 answer

How to build GCC 4.8.x on Mac OS X host for MIPS target

I am trying to build GCC / binutils for a MIPS target platform on a Mac OS X host running (10.9) x86_64. I have downloaded the latest version of binutils and GCC to my knowledge, and I have also installed GCC 4.8.2 via homebrew. However, so far I…
ipatch
  • 3,933
  • 8
  • 60
  • 99
9
votes
2 answers

gnu ld/gdb: separate debug files. How to produce the debug file when there's too much debug info to link?

There's now gdb and binutils support for separating debug info from the binaries to be debugged. Docs describing this can be found in: gdb: separate debug files objcopy --add-gnu-debuglink, --only-keep-debug ld --build-id After a bit of…
Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
9
votes
2 answers

Linker failed: .gnu.linkonce.t

I'm having trouble linking a shared library using GCC 3.2.3 with binutils 2.18. When I try to link the library I get the following error: .gnu.linkonce.t_... referenced in section .rodata: defined in discarded section .gnu.linkonce.t... I've done…
Joe Corkery
  • 2,564
  • 3
  • 18
  • 26
8
votes
3 answers

How to compile an assembly file to a raw binary (like DOS .com) format with GNU assembler (as)?

I want to compile this source code in Windows (It just an example): start: NOP NOP When I compile it with NASM or FASM, output file length is 2 bytes. But when I compile it with GNU assembler (as) the output file length is 292 bytes! How to…
Amir Saniyan
  • 13,014
  • 20
  • 92
  • 137
8
votes
0 answers

How to Strip A Symbol in Relocation

i try to remove a symbol from object file as below: gcc -c test.c strip --strip-symbol=test_sym test.o test.o test_sym is a function implemented in test.c. strip returns following message : strip: not stripping symbol 'test_sym' because it is…
RedArrow
  • 588
  • 8
  • 18
8
votes
1 answer

Adding .o files path to ld default (crtbeginS.o, not .so files)

When using GCC to compile most things, I get this error: /..//bin/ld: cannot find crtbeginS.o: No such file or directory crtbeginS.o exists at /usr/local/lib/gcc/x86_64-unknown-linux-gnu/6.0.0/crtbeginS.o (Installed from GCC trunk, 6.0.0-trunk) I…
user1902689
  • 1,655
  • 2
  • 22
  • 33
1 2
3
27 28