Questions tagged [objcopy]
The objcopy tag has no usage guidance.
objcopy
146
questions
0
votes
1
answer
34
views
renaming .data to .rodata using objcopy fills output with zeros
Following this helpful guide, I am using objcopy to embed a large data file in my code, like so:
arm-none-eabi-objcopy -I binary -O elf32-littlearm "raw_data.bin" "raw_data.o"
...
-2
votes
0
answers
33
views
objcopy says one of input files was not recognized as a valid object file
Im trying to objcopy two files together but its just not working...
I tried the following:
objcopy -I bootloader.bin extendedprogram.bin -O bootloader.flp
The result was:
llvm-objcopy: error: '...
1
vote
0
answers
45
views
Using llvm-objcopy to remove symbols from static library (mach-o)
I am trying to use llvm-objcopy (or llvm-strip) to remove a symbol from a static library (mach-o). I am doing the following:
$ llvm-objcopy --strip-symbol "...
0
votes
1
answer
74
views
Display source code with disassembly when path has changed
We have some static libraries for a know arch (e.g. powerpc) in which we need to display source code with disassembly to perform some asm review activities.
However, the binaries were cross-compiled ...
0
votes
2
answers
174
views
How to specify symbol name when creating objects from raw binary files using objcopy?
As described in this answer, GNU objcopy can be used to create object files from arbitrary file content. This method can be used to embed resources into programs. However, the symbol name is generated ...
0
votes
0
answers
100
views
Zero pad RISC-V compressed instruction from objcopy
I have generated the ELF file and I am able to generate the Verilog format using riscv64-unknown-elf-objcopy tool. The problem is I have compressed instructions like below, but I am parsing the file ...
0
votes
1
answer
369
views
fix elf segment address on an objcopy output binary
I'm trying to inject some compiled code into an elf executable. The strategy is to write some bytes at the end of the 'code' segment. The reason why I chose that segment is because I need my payload ...
0
votes
0
answers
61
views
gcc:linker: set section size to 8 bytes
I am running arm-none-eabi-objcopy -O verilog -S --reverse-bytes=4 --verilog-data-width 8 -R .comment --gap-fill 0 --pad-to 0x2000 bin/main.elf bin/main.verilog
To convert my code in a format ...
0
votes
1
answer
126
views
SDCC produces elf output with sections of NULL type
I am using SDCC to produce an ELF file. I then convert this ELF file to a binary file. Sadly the output is not as expected. The output is not positioned correctly and there are strange zero length ...
1
vote
0
answers
217
views
Is it legal to use --rename-section and --add-symbol with objdump at the same time?
I am using following command:
echo 'SOME_DATA' > data.file \
&& objcopy \
--input-target binary \
--output-target=elf64-x86-64 \
--rename-section .data=.my_data_section \
...
0
votes
0
answers
82
views
How to avoid CMake writting full path of objects to the static library?
The original issue is here.
After a few days, I find the problem is here.
I tried to use the following CMakeLists.txt to build tcmalloc_minimal_static.lib:
#...
# https://github.com/gperftools/...
0
votes
1
answer
356
views
Why does objcopy remove my section from binary?
I'm trying to link my tiny bare-metal educational project for ARM. I have one simple assembly source and linker script. There is a special separate section for exception vectors and startup code:
....
0
votes
1
answer
402
views
.rodata section breaks after moving an object out of the function scope
I'm building a simple payload to execute on an ARM64 system that will print a "Hello, world!" string over UART.
hello-world-payload.c:
#include <stdint.h>
typedef uint32_t u32;
int ...
1
vote
1
answer
244
views
--localize-symbol does not work on windows with mingw-w64
I have two files
foo_var.c
int global_var = 1;
foo_print.c
#include <stdio.h>
extern int global_var;
void print_foo(void)
{
printf("print_foo = %d\n", global_var);
}
that ...
1
vote
0
answers
168
views
objcopy breaks shared library alignment on libgfortran-2e0d59d6.so.5.0.0
I'm trying to add a new section to the dynamic library(libgfortran-2e0d59d6.so.5.0.0) using an objcopy tool, but looks like it breaks file alignment, which is checked by python during a library load.
...