[U-Boot] [PATCH/RFC] unify version_string

Mike Frysinger vapier at gentoo.org
Fri Jun 24 22:52:54 CEST 2011


On Fri, Jun 24, 2011 at 16:07, Wolfgang Denk wrote:
> Mike Frysinger wrote:
>> > U-Boot image starts with the magic number, followed immediately by
>> > the version string. That means, you can trivially identify any binary
>> > image, be it as file on the host or on the target, or programmed into
>> > flash, but just dumping the first bytes of it, for example:
>>
>> cant you do this with a linker script update ?
>
> Insert strings in the middle of code?

you arent inserting it into the middle of code, you're inserting it at
the head of the link.  should be pretty easy to do.  atm, you're
relying on the start.S file always producing code as laid out in the
file, and the linker picking up start.o first.

> I don't see the real problem.  I mean, we can provide the definition
> of the string in some common header file, and then just use it where
> needed.

cmd_version.c could still have a common version_string definition and
mark it weak.  then any arches doing whatever crazy thing they want
can override it with a non-weak symbol.
-mike


More information about the U-Boot mailing list