This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
converting binary file into object
- From: Christian Groessler <cpg at aladdin dot de>
- To: binutils at sources dot redhat dot com
- Cc: chris at groessler dot org
- Date: 19 May 2002 19:18:46 +0200
- Subject: converting binary file into object
Hi,
I'm trying to include a binary file into an object.
I'm using ld, with the following cmdline
sh-elf-ld --format binary --oformat elf32-shl input.bin -o output.o \
-r -EL -T script.ld
script.ld contains this:
SECTIONS { .rodata : { _bin_start = .; *(.data); _bin_end = .; } }
Looking at the resulting obj with objdump gives the following:
-------------------
output.o: file format elf32-shl
output.o
architecture: sh4, flags 0x00000010:
HAS_SYMS
start address 0x00000000
Sections:
Idx Name Size VMA LMA File off Algn
0 .rodata 00000ae8 00000000 00000000 00000034 2**0
CONTENTS, ALLOC, LOAD, DATA
SYMBOL TABLE:
00000000 l d .rodata 00000000
00000000 l d *ABS* 00000000
00000000 l d *ABS* 00000000
00000000 l d *ABS* 00000000
00000ae8 g .rodata 00000000 _binary_input_bin_end
00000ae8 g .rodata 00000000 _bin_end
00000ae8 g *ABS* 00000000 _binary_input_bin_size
00000000 g .rodata 00000000 _bin_start
00000000 g .rodata 00000000 _binary_input_bin_start
-------------------
Now my question: How can I set the .rodata section flags to include
READONLY, and how can I set it's alignment to 4 (2**2)?
regards,
chris