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).
Questions tagged [binutils]
418 questions
3
votes
1 answer
or32-uclinux-gcc gives assembler messages: no such instruction
I wanted to use the cross-compiler for some testing on an or1200 design in which I used to perform some benchmarks on another machine. The other machine had the binaries of the or32-uclinux- tool chain and I coppied those to my Ubuntu 20.04…

ex1led
- 427
- 5
- 21
3
votes
1 answer
GNU ld: -z origin? -rpath $ORIGIN/../lib?
A legacy makefile that I'm trying to understand has -Wl,-z,origin,-rpath,'$ORIGIN/../lib'
OK, I see -Wl means the following are linker options; the commas will be replaced with spaces.
The manpage for the GNU ld mysteriously only says:
-z…

Swiss Frank
- 1,985
- 15
- 33
3
votes
0 answers
What is the difference between strip --remove-section vs objcopy --remove-section
Both strip and objcopy binary utilities support [--remove-section=sectionname] option.
Is there a difference between the two options ? Are there cases when one should be preferred over the other?

Cherry Vanc
- 781
- 1
- 4
- 19
3
votes
0 answers
Create stub library/object from application code (ROM) using binutils for bare-metal ARM
I have some C code that is implemented in a ROM. I'd like to link an application against that code, so I can save some space (as my application won't have to include the ROM code as it's already in the ROM). My question is about how to do this in an…

Leonardo
- 1,533
- 17
- 28
3
votes
1 answer
Inspect and get binary from ELF file on MAC
I have a ELF file and I want to get a hex or bin file of my code from it. In the terminal, if a do a file main, which is my file, it shows:
main: ELF 32-bit LSB executable, UCB RISC-V, version 1 (SYSV), statically linked, not stripped
As I learned,…

Kralik_011
- 393
- 1
- 3
- 14
3
votes
2 answers
LINKER script GCC how to avoid veneer call
I work on the project where I copy some functions to the RAM from FLASH and call them. Everything is OK except one small problem I have - if I call function directly the compiler adds the veneer call instead (which calls the funtion in the RAM…

0___________
- 60,014
- 4
- 34
- 74
3
votes
1 answer
Referring to a specific symbol in a static library with the GNU gold linker
When laying out symbols in the address space using a linker script, ld allows to
refer to a specific symbol coming from a static library with the following
syntax:
archive.a:object_file.o(.section.symbol_name)
Using gold rather than ld, it seems…

pierreolivier
- 33
- 4
3
votes
2 answers
Force specified function to be linked to a specified lib when compiling/linking
I am wondering whether it is possible to force the linker to use some specified function to link to when compiling/linking.
I am using the LD_PRELOAD environment variable to hook some specified functions but I am not so familiar with linker so there…

walkerlala
- 1,599
- 1
- 19
- 32
3
votes
2 answers
Setting earlier minimum kernel version when compiling static libraries
My distribution (Arch Linux) recently increased the minimum supported Linux kernel version for its toolchain. I am compiling a web application that I link statically and then upload to a web server, and the kernel version on the web server is too…

ajd
- 1,022
- 1
- 8
- 21
3
votes
1 answer
'size' vs 'ls -l' to get the size of an executable file
For the same file, I think the output of ls -l xxx is always greater than or equal to the output of size xxx.
But when I type ls -l /bin/ls the output is:
-rwxr-xr-x 1 root root 104508 1月 14 2015 /bin/ls
For size /bin/ls, the output is:
text…

Divlaker
- 401
- 6
- 16
3
votes
1 answer
How to determine architecture to build GCC cross compiler?
I'm trying to set up a build server on Linux which I will use to build C/C++ apps for Windows and Mac.
I know that GCC supports a body of different architectures but I can't figure out how to determine targets against which I need to build GCC cross…

senx
- 630
- 9
- 18
3
votes
1 answer
Binutils LD creates huge files
I'm trying to create as small ELF as possible. I created a test file like this (NASM syntax):
SECTION .text
dd 0xdeadbeef
With this linker script:
SECTIONS {
.text : {
*(.text)
}
}
Then I checked sizes of flat binary and ELFs built…

Maya
- 1,490
- 12
- 24
3
votes
0 answers
show largest symbols in certain section (GNU gcc/binutils)
In my embedded project, I need to figure out where I start to further optimize (i.e. reduce) stuff in the .data section. What command(s) do you use for an quick overview which symbols reserve large amounts of memory in a certain section? I use the…

apriori
- 1,260
- 11
- 29
3
votes
1 answer
cross building binutils 2.25.1 for iOS8.4 (arm64-apple-darwin14.0.0)
EDIT. 2015-30-10. I tried this :
../configure --prefix=/usr/local/GNU-CROSS/binutils-2.25.1/ CC="clang -fembed-bitcode -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -Wno-error…

Olórin
- 3,367
- 2
- 22
- 42
3
votes
0 answers
GNU binutils: move compiled functions to sections
GCC has a useful option to place each function into its own section during compile time (-ffunction-sections). It's useful to optimize away unused functions during linking the binary (-gc-sections).
I have a static library and don't have a source of…

Ivan Mikhailov
- 31
- 1