This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
objcopy - allocated section not in segment
- From: "Jafa" <jafa at silicondust dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Thu, 22 May 2003 16:21:48 -0700
- Subject: objcopy - allocated section not in segment
- Reply-to: "Jafa" <jafa at silicondust dot com>
Hi all,
I am getting the warning "warning: allocated section `.filemedia' not in
segment" when I run the following command to add a binary image into a new
section in an elf file:
ip2k-elf-objcopy build/bin/ip2kvm_webserver_i.elf ip2kvm_webserver.elf \
--add-section .filemedia=build/bin/upgrade.bin \
--change-section-lma .filemedia=0x03000000 \
--change-section-vma .filemedia=0x03000000 \
--set-section-flags .filemedia=contents,alloc,data,load
Looking at the BFD code the new section isn't in a segment (unlike every
existing section) and the warning is generated because it is marked as
allocatable. The generated elf file is correct but we are getting hundreds
of these warnings in our nightly builds so it is starting to get annoying
:-)
If I split the objcopy into two then the warning goes away:
ip2k-elf-objcopy build/bin/ip2kvm_webserver_i.elf ip2kvm_webserver.elf \
--add-section .filemedia=build/bin/upgrade.bin \
--change-section-lma .filemedia=0x03000000 \
--change-section-vma .filemedia=0x03000000
ip2k-elf-objcopy ip2kvm_webserver.elf ip2kvm_webserver.elf \
--set-section-flags .filemedia=contents,alloc,data,load
The problem here is that I would need to create an intermediate file to
guarantee it works even if make gets interrupted, and it doesn't address
anything about the segment - it doesn't generate the warning because it
isn't allocatable at the time it is created.
I guess I don't quite understand the segment problem here and I would
appreciate any advice.
Thanks
Nick