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

binutils
Filter by
Sorted by
Tagged with
2 votes
1 answer
1k views

Merge additional code into executable (arm-linux)

I'm trying to merge some extra logging code into a statically linked (android arm linux) executable. (Normal tracing methods don't seem to work, as it's a daemon process that clone()s just before ...
Chris Stratton's user avatar
2 votes
3 answers
503 views

gcc to tell a register compiled from which variable

I need to know from which variable is a register of a binary instruction in the obj file is compiled from. In short: the mapping from the register to variable for each instruction Example: suppose ...
lukmac's user avatar
  • 4,711
1 vote
2 answers
2k views

Trying to no-op an instruction

Is it possible using GNU tools (gcc, binutils, etc) to modify all occurrences of an assembly instruction into a no-op? Specifically, gcc with the -pg option generates the following assembly (ARM): ...
ctuffli's user avatar
  • 3,569
1 vote
2 answers
3k views

Rewrite shared library undef symbol version of compiled object

I am trying to compile and link a program (let's call it myprog) which is linked against a shared library (in this instance libcryto & libssl, but the actual library is not relevant). I am ...
abligh's user avatar
  • 24.9k
1 vote
2 answers
2k views

Redefining symbols from shared library

I have a requirement on changing certain symbols from shared library (.so) files like below example: i need to rename symbol abc in .so file to symbol xyz. I have a tool to replace it in header files, ...
praveen's user avatar
  • 21
1 vote
1 answer
881 views

How do I find which version of gcc corressponds to which version of binutils?

Exactly as the question sounds. If there isn't a generic way to answer this question for any given version pair, can someone at least answer the specific question of whether gcc 3.4.6 and ld 2.15.92....
owagh's user avatar
  • 3,488
1 vote
1 answer
1k views

Get free space left on target from arm-none-eabi-size

I want to calculate space left on my embedded target. The Arduino IDE shows this in the output window: Sketch uses 9544 bytes (3%) of program storage space. Maximum is 262144 bytes. avr-size has -C ...
Laurenz's user avatar
  • 1,870
1 vote
2 answers
506 views

ELF Relocation - where came from these symbols?

In my Debian x86 32 Bits, when I do readelf -r /usr/lib/libstdc++.so.6 | grep pthread, I get this output: 000eceac 00006206 R_386_GLOB_DAT 00000000 pthread_cancel 000ed058 00000807 ...
JohnTortugo's user avatar
  • 6,526
1 vote
1 answer
461 views

how do I dump the shellcode from an aarch64 binary with objcopy?

I have a simple assembly code (aarch64) as follows, mov x1, #1 mov x1, #2 and I want to convert it to shellcode. What I did: #> as simple.s -o simple.o #> objcopy -O binary simple.o simple....
prgbenz's user avatar
  • 1,149
1 vote
2 answers
1k views

g++: as fails to determine which assembler to run

Today I wanted to recompile one of my projects. Compiling this project had already worked on my machine, but this time an error occured. The compiler output goes: fatal error: as: unknown host ...
Leso_KN's user avatar
  • 168
1 vote
1 answer
729 views

building cross binutils fr30-unknown-none unsupported

I am trying to build a cross binutilsfor fr30. After running the configure command : ./configure --target=fr30 --enable-cgen-maint --prefix=/<long_path>/myBinutils/new_build_fr30_cgen/ I run ...
yehudahs's user avatar
  • 2,626
1 vote
1 answer
4k views

ld: undefined symbol vs ld: undefined reference

What is the difference between these errors in GNU Binutils ld ? undefined reference undefined symbol I have a good understanding of undefined reference: This occurs for example when the loader ...
Adam's user avatar
  • 67
1 vote
1 answer
3k views

GCJ Linking Error: Says error: undefined reference to 'main' collect2: error: ld returned 1 exit status

The code is this: public class Thingy { public static void main(String[] args) { System.out.println(Math.random()); } } So, absolutely NOT an unusual case, just a basic example. When I ...
user2093092's user avatar
1 vote
2 answers
2k views

How to get information from objdump

I encounter a problem when reading information dumped out from an executable file in linux. The information is as follows: 804a0ea: 04 08 add $0x8, %al ... 804a0f4: a6 ...
Summer_More_More_Tea's user avatar
1 vote
1 answer
50 views

how to decompose elf file size into different size of sections or symbols?

I want to know each symbol's size in elf executable or dynamic library and I assume the total symble size and other stuff's size can add up to the file size. From size command I can see all section ...
Lewis Chan's user avatar
1 vote
1 answer
2k views

Why does ld-linux-x86-64.so.2 link against unexpected location?

I have installed a new glibc in /root/tools/ in debian which already has a pre-installed glibc. For testing the new glibc, I type : gcc test.c -Wl,-rpath=/root/tools/lib -Wl,--dynamic-linker=/root/...
Li-Guangda's user avatar
1 vote
1 answer
93 views

What's the meaning of elfnn-<arch>.c and elfxx-<arch>.c in binutils/bfd?

I am tracing binutils source code. I found that there are files named elfnn-<arch>.c and elfxx-<arch>.c in binutils/bfd. What't the meaning of elfnn and elfxx? Thanks.
Hsu Hau's user avatar
  • 604
1 vote
1 answer
855 views

Why is the text-segment of an executable offset (nonzero)?

This question follows from What does SEGMENT_START("text-segment", 0x400000) represent? From the noted question, I learned that the addresses mentioned in the memory map, used to build ...
StoneThrow's user avatar
  • 5,943
1 vote
2 answers
599 views

Extract read-only data sections from an archive/lib (ELF i guess?) for compression

UPDATE: So the question is as follows: My build setup generates an archive/lib (binary output), which I would like to extract some data from, for compression in my case, but that really is not the ...
S.C. Madsen's user avatar
  • 5,188
1 vote
1 answer
2k views

Makefile.def vs Makefile.am

I am working on linux binutils-2.29. In the parent directory there is not Makefile.am, but in all the sub directories there is Makefile.am. In the parent directory these are the Makefiles present: ...
Dinesh Gowda's user avatar
  • 1,104
1 vote
1 answer
1k views

Find out a function symbol's visibility in an object file (.o)

I only cares about default/hidden visibility. The .o file is not compiled with IPO. How to find out a symbol's visibility in the .o file? Why I have to find it out from .o file: On certain ...
user2771324's user avatar
1 vote
1 answer
562 views

Linking object files of differing types

I am trying to link object files which had originally been created by two different assemblers. We have some legacy assembly code that was compiled into object files using an old MRI assembler for ...
Michael Bauer's user avatar
1 vote
1 answer
3k views

Error compiling against libopcodes

I'm following some code from here which is as follows: The OP says that you can link with -lbfd -lopcodes. However, for OpenSuSE I've found that for libbfd I need -lbfd -liberty -lz -ldl When ...
SailorCire's user avatar
1 vote
1 answer
4k views

Binary files format (ARM GCC)

what contains a binary file which come from a ARM GCC for ARM devices? Is there inside it some information about destination address which write to? Or just native, pure, content of program without ...
MrBit's user avatar
  • 290
1 vote
1 answer
214 views

can't understand how to use sim folder in binutils

I am porting binutils to a new arch. What is the sim folder for ? and how can I use it ? If I understand correctly, the sim folder suppose to build some kind of simulator for the new arch but I can't ...
yehudahs's user avatar
  • 2,626
1 vote
1 answer
2k views

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 ...
Martin Richtarsky's user avatar
1 vote
1 answer
699 views

Proper usage of ARMv6 equates: .equ .reg .set

Using the GNU Assembler Manual, v2.19.51, I was not able to find a definitive difference between these types of equates: .equ .reg .set Does anyone know the difference and proper usage?
bluestar's user avatar
1 vote
1 answer
3k views

Arch Linux doesn't have i586-elf-gcc or i586-elf-gcc

I'm attempting to create a C kernel initially following this tutorial: http://wiki.osdev.org/Bare_Bones However, my system doesn't have i586-elf-gcc or i586-elf-ld. I'm really not sure where I can ...
Max Smashdidypwned Lay's user avatar
1 vote
2 answers
1k views

gdb: how does it know the variable type and size?

I'm trying to figure this out as I'm trying to do the same thing (hopefully) with a home grown script: Example C code: typedef struct _B { A aa; double b; char c[LEN]; int d; ...
lang2's user avatar
  • 11.7k
1 vote
1 answer
3k views

Is it possible to use MIPS register names with GAS (GNU assembler)?

If I use register names I get: Error: illegal operands `add $t0,$zero,$zero' If I use register number ($8 instead of $t0 and $0 instead of $zero) it works. (I'm using binutils 2.17).
Yonatan Broza's user avatar
1 vote
1 answer
838 views

pass -fcommon flag in CFLAGS for make

The build code of binutils: echo -e "${BLUE}===================== build gas && gold ===========================${NC}" echo if [ ! -f ${PWD_PATH}/succeed/binutils ]; then wget -c ...
NobinPegasus's user avatar
1 vote
1 answer
191 views

What is the safest way to get a newer version of a repo from yum on Amazon Linux?

I need a newer version of binutils on Amazon Linux to compile a piece of needed software. This is due to a bug in version 2.29 which is the latest available in their repo. What would be the best way ...
David's user avatar
  • 1,642
1 vote
1 answer
284 views

Binutils / Linker - Resolve external symbol references statically

Background I am working on some projects target old embedded devices with latest GNU toolchain. Since the memory is very limited, the code is separated into a main part and some overlays, in which the ...
imakak's user avatar
  • 198
1 vote
1 answer
1k views

ld --export-dynamic for just one library?

It's possible to pass --export-dynamic to ld and this will export symbols in the program (so that they are available to any shared libraries loaded at run-time): $ cat > test.c void foo() {} int ...
Andrew Tomazos's user avatar
1 vote
1 answer
891 views

What does "readelf error: LEB value too large" mean?

What exactly does mean this error and what can cause it? readelf: Error: LEB value too large What LEB stands for? Lower(st) estimated bound(ary)? I have seen it many times, in particular when ...
Scrooge McDuck's user avatar
1 vote
1 answer
168 views

nm: some symbols are not related to any source file

In my embedded project I compile amazon-freertos/lib/FreeRTOS-Plus-TCP/FreeRTOS_Sockets.c in this way: /opt/gcc-arm-none-eabi-8-2019-q3-update/bin/arm-none-eabi-gcc \ -std=gnu11 \ -mcpu=...
mastupristi's user avatar
  • 1,286
1 vote
1 answer
363 views

Getting a list of archive members used while linking a static library

Is there a ready-made solution for getting a list of the archive members that got used (or would be used) while linking in an archive (i.e. a static library)? Say if I have an object file that ...
Petr Skocik's user avatar
  • 59.2k
1 vote
1 answer
3k views

How to make `objcopy` support efi-app target?

The following makefile snippet seems to objcopy command line options to convert a .so file into a .efi file. OBJCOPYFLAGS = \ -j .text\ -j .sdata\ -j .data\ -j .dynamic\ -j ....
smwikipedia's user avatar
  • 63.2k
1 vote
1 answer
711 views

Gcc, binutils and minimal support version of glibc?

How I can to know what is a minimal version of glibc for gcc or binutils? Regards.
Valeriy Solovyov's user avatar
1 vote
1 answer
2k views

GCC & binutils build - C compiler cannot create executables

I'm trying to build gcc-5.3 and binutils-2.26. I've done it like this: mkdir gcc; cd gcc wget http://path/to/gcc-5.3.0.tar.bz2 wget http://path/to/binutils-2.26.tar.bz2 tar xf gcc-5.3.0.tar.bz2 tar ...
Tom's user avatar
  • 7,530
1 vote
1 answer
470 views

Wildcard doesn't work in Mingw (Windows) GNU ld script

I am using the tool chain provided by GCC ARM Embedded. It seems ld (4.9-2015-q3-update) cannot handle wild card (*) with Windows path correctly. For example, the code snippet below .foo_v0 { obj\*(....
chenwj's user avatar
  • 2,039
1 vote
1 answer
837 views

What is the meaning/purpose of the "=" that sometimes appears in the SEARCH_DIR command in binutils' ldscripts?

When I build binutils, the ldscripts folder contains several files that are used by ld to determine how to link objects for a particular platform. In the scripts I see lines like: SEARCH_DIR("/...
user1261695's user avatar
1 vote
1 answer
1k views

what are the common symbols in objdump?

I'm reading the documentation of objdump in : objdump manual and in the line that specifies the output of the symbol table for ELF based files entries with the -t option, there's one line that i ...
Mike's user avatar
  • 331
1 vote
1 answer
1k views

prebuilt binutils that run on android device

I can not find any built versions of the binutils that could be pushed to an Android device an then be executed from there. The Android NDK toolchain provides them but in the wrong format. Devices ...
whateverrmaan's user avatar
1 vote
1 answer
2k views

How to build binutils for a specific target

I'm trying to configure binutils for an ARM processor, specifically the ARMv5TE. The processor is the Marvell 88F5281. Presently the device is running NetBSD, so I want to make sure I configure ...
ipatch's user avatar
  • 3,992
1 vote
1 answer
2k views

android NDK: objcopy --rename-sym does not work (need to rename a function in a .so file)

I cannot get objcopy --rename-sym working. In a new Android project, I have created the directory jni and the file stub.c: #include <jni.h> #include "dlog.h" jint JNI_OnLoad(JavaVM* vm, void* ...
18446744073709551615's user avatar
1 vote
2 answers
216 views

Access violation gas read syscall

I am new to assembly language and am facing a problem in my first steps. I have some experience with high level languages but I feel like a total beginner in this low level. I am using the GNU ...
linluk's user avatar
  • 1,650
1 vote
1 answer
388 views

problems in building the oprenrisc toolchain

I want to build the openrisc toochain on my virtual machine ubuntu 12.04. I succeed to do this one time before my vm crashed for some reasons, but now I am unable to do it. I am following these ...
mohessaid's user avatar
  • 390
1 vote
2 answers
702 views

libopcodes: get the size of a instruction

I have to find out the size of a instruction which I have in memory (actually, I have a small code segment in memory and want to get the size of the first instruction). It took me some time to find ...
Sebastian Wick's user avatar
1 vote
1 answer
281 views

ar command line length

I have an extremely long command line given to ar (android ar exactly) by bjam, and ar just corrupts a file path and complains that file does not exist. Is there a way to make ar allocate a bigger ...
costy.petrisor's user avatar

1
3 4
5
6 7
9