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).

380 questions
9
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
  • 5,946
  • 21
  • 32
9
votes
4 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
  • 195,354
  • 31
  • 331
  • 669
9
votes
2 answers

Building a two-part firmware image using GCC toolchain

I have some firmware built with GCC that runs on an ARM Cortex M0 based microcontroller. The build currently generates a single binary image that can be written into the program memory of the microcontroller. For reasons to do with field update, I…
Martin L
  • 866
  • 7
  • 11
9
votes
1 answer

Why were GNU binutils and GDB merged as one package?

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git See, especially, the tags section. What was the rationale behind this decision? Does the merge affect the suggested way to build latest binutils and GDB? (In fact when I checked out…
nodakai
  • 6,891
  • 3
  • 24
  • 51
9
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
  • 269
  • 2
  • 12
9
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,047
  • 21
  • 24
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,441
  • 6
  • 54
  • 91
8
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,712
  • 1
  • 29
  • 32
8
votes
1 answer

how to determine object code size on Linux when "size" gives the wrong answer?

I want to know precisely how much object code is generated by GCC for each of a collection of compilation units, but I'm having an odd problem where the "size" command from binutils is not giving the correct result. Let's take a C file containing…
John Regehr
  • 123
  • 1
  • 6
8
votes
2 answers

ELF Dynamic loader symbol lookup ordering

What is the search order for symbol lookup when resolving dynamic relocations? When resolving symbols for a shared library does the loader first search in the 'main executable' (to let the main executable override definitions...) or what?
JohnTortugo
  • 5,435
  • 7
  • 33
  • 63
8
votes
2 answers

Help with linker failer: .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 a…
Joe Corkery
  • 2,416
  • 3
  • 18
  • 26
7
votes
2 answers

Is there a binutils for llvm?

The LLVM compiler toolchain has a gcc that is compatible with normal gcc. The advantage of using llvm-gcc is that is goes to an arbitrary target, meaning normal gcc will say no such target when you try to compile to a random architecture, say…
Leo Izen
  • 4,031
  • 7
  • 32
  • 54
7
votes
1 answer

List of targets supported by binutils

I am following a website ( http://wiki.osdev.org/GCC_Cross-Compiler ) to learn how to cross compile some code for different architectures. So, the first step is to download and compile Binutils for a specific target. The site say to assign the…
infoclogged
  • 2,639
  • 2
  • 21
  • 43
7
votes
1 answer

Why is there unused, empty space between ELF sections?

It seems that binaries created with gcc 4.9.2 on Linux (Ubuntu 15.04, 32-bit) have a couple of thousand unused bytes between sections .eh_frame and .init_array. Example output from objdump -h for a simple executable: Sections: Idx Name Size…
nwellnhof
  • 28,336
  • 5
  • 76
  • 103
7
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,367
  • 2
  • 17
  • 31
1 2
3
25 26