Questions tagged [objcopy]
142 questions
1
vote
0 answers
objcopy: bloated binary output file
While working on my bootloader project, I noticed that the resulting binary file is larger than the sum of the sizes of each section in the original ELF file.
After linking the bootloader image via ld, the ELF file is structured as follows:
$…

CRoemheld
- 889
- 7
- 26
1
vote
1 answer
Renaming symbols fails with errors
i have installed new glib library version 2.6 , And after creation i am trying to rename some of the symbols in glib library using objcopy command. Renaming symbols is necessary for our project support.
It fails with error below
objcopy…

Naga
- 59
- 8
1
vote
1 answer
How to extract the __bitcode/__bundle section from a MachO binary
For a binary with embedded bitcode (i.e., compiled with -fembed-bitcode). How can i just extract that section such that I can use that bitcode file like any other bitcode file e.g, run opt or llvm-dis
As a testcase i have this hello-world…

A. K.
- 34,395
- 15
- 52
- 89
1
vote
1 answer
Create motorola s-record with fixed size length
Because I have to use a third-party bootloader which cannot handle varying lengths of lines in an SREC file, I need a way to instrument objcopy to create a SREC file, where every S1 line has the same lengths (if no info from ELF file is provided, it…

RoQuOTriX
- 2,871
- 14
- 25
1
vote
1 answer
c# capture raw data from a GNU objcopy process, that dumps to a file
I need to process in-memory within C# some dump offered by OBJCOPY utility.
When used from command prompt, I use it like this:
objcopy myprogram.elf --dump-section .text=text_section.txt
This is how I obtain the RAW content of .text section into a…

yo3hcv
- 1,531
- 2
- 17
- 27
1
vote
1 answer
Generated binary file from elf file explodes if NOLOAD is removed from section
We have a linker script with a custom section that was added for some IEC compliance test reasons. However, ever since adding this section the binary size created via objcopy -O binary input output has exploded from ~150kbytes to ~ 512Mbytes.
I've…

Daan Timmer
- 14,771
- 6
- 34
- 66
1
vote
1 answer
I have generated a linux core dump with debug symbols in target system. But I am unable to debug the dump using GDB in host system
I am building a debugging system to debug a exe(e.g. coredump) which is crashed in remote system. The debug symbols along with the core dump (e.g. coredump.dbg, coredump_core.dump) is sent to host system. In host system when I use GDB to analyze a…
1
vote
1 answer
objcopy is removing a section unless I declare a static volatile variable in that section (using attribute)
I have a linker script in which I have defined a section for containing the checksum of a software image. Something like:
...
.my_checksum :
{
__checksum_is_here = .;
KEEP (*(.my_checksum))
. = ALIGN(4);
_sw_image_code_end = .;
…

Dan
- 2,452
- 20
- 45
1
vote
1 answer
Padding binary files from a specific address point to another specific address point in address
Problem description:
I have two binary files(lets call them file A and B). File A is the kernel and file B is the application to be run on(yes it is an embedded operative system). With file A i need to fill the gap from the end of the kernel to the…

EmbeddedOS
- 173
- 6
- 18
1
vote
1 answer
ELF. Hide exported symbol for already linked DSO
I have an already compiled / linked DSO file, that exports few functions that indeed must be hidden. When I try to link my code against that library - it picks up those unneeded symbols instead of my own ones. I have no access to the source code, so…

Sergio
- 8,099
- 2
- 26
- 52
1
vote
0 answers
Inserting code in an elf/bin file
I need to compile a piece of code, called program A, and obtain the ELF file with the physical addresses given by the linker.
Then, I need to compile program B and inject its code into program A which I cannot recompile, since I would lose…

Jose Lopes
- 11
- 1
1
vote
1 answer
Removing S0 record form SREC file
I'm working on embedded system running on WindRiver's VxWorks 653. After building binary files converted to SREC with objcopy for burning into target device. But this SREC files contain an S0 record with directory where it was built, so build same…

Paul Shkil
- 13
- 2
1
vote
1 answer
Still reports "undefined symbol: new_add" after use "objcopy --redefine-sym add=new_ad"
I need to load two dynamic libraries and there is one function name confliction. So I use the the command "objcopy --redefine-sym add=new_add libmy_test.so libmy_test_new.so" to modify the symbol name.
But it still reports "Error:…

linuxer
- 326
- 4
- 14
1
vote
1 answer
How to replace a section of an elf file with another using objcopy or libelf, such that it does get loaded into the Memory?
I have a project where I need to remove a section of an ELF file and replace it with another section with slightly modified contents.
I was able to first remove the original section and then add my desired section using objcopy. But I always get…

Abhay
- 19
- 1
- 3
1
vote
1 answer
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 .dynsym\
-j .rel\
-j .rela\
-j .reloc\
…

smwikipedia
- 61,609
- 92
- 309
- 482