This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: objcopy fails silently with an empty input file


Hi Shaun,

Fair enough. The empty file is of limited use. I have an application
that writes a payload binary to flash. To make sure the build
succeeds, if a payload binary wasn't provided make simply touched
'payload.bin'.

If no payload was provided then shouldn't the build fail ? [Of course it is your system so it can behave as you wish].


This had the slight benefit that if this app was
mistakenly run it wouldn't bork the flash, since the payload is zero
bytes. I'll replace 'touch payload.bin' with 'echo empty >
payload.bin', but this inherent benefit is lost. Instead, the app will
just have to check for a signature byte.

You could easily create an dummy empty.o (eg using the objcopy patched in the way you suggested) and then just copy this file into place if the build process failed to create a non-zero length output file.


Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]