From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Clifton To: "Andreas Bürgel" Cc: binutils@sources.redhat.com Subject: Re: still problems linking plain data into an application (arm-elf) Date: Tue, 29 May 2001 00:56:00 -0000 Message-id: References: <200105281634.f4SGYk801698@mailgate3.cinetic.de> X-SW-Source: 2001-05/msg00513.html Hi Andreas, > I want to link a plain data file - hex format or binary - into my > application. Currently I'm using a linker script with an > input-command "INPUT ()". Unfortunately the only format > the linker pretends to recognize ist "Intel Hex", using other > formats I get a " File format not recognized"-error. Another way to solve this problem is to use objcopy to convert the data file into an ELF format file and then just link it in. For example: objcopy -I binary -O elf32-little-arm data_file new_object.o You may get an error message "Warning: Output file cannot represent architecture UNKNOWN!" in which case add a -B option like this: objcopy -I binary -O elf32-little-arm -B arm data_file new_object.o This will create an object file with the data in a .data section. If this is unsuitable you can then use the linker and a small little script to rename the section to something else, as in: ld -T convert.ls new_object.o -o resectioned_object.o and the linker script looks like: SECTIONS { .new_section_name : { *(.data) } } Cheers Nick