You miss my point.
Notes are a generic mechanism, and there could be notes in an executable for
reasons other than capabilties. You can't rely on the CAPS note being first
because something might put another note before it. Those other notes may be
something associated with CAPS, like a digital signature. Your technique would
immediately break as soon as someone tries to do something else with ELF notes.
The reason I made "addnote" very generic (even to the generic name) is that
there's a real possibility that notes in an executable will be more generally
useful, and I wanted to make sure the tools were available for doing it
properly. For the same reason, the kernel code which parses the ELF notes
should conform to the spec, rather than some half-assed hack. The code to do
it properly is a little longer, but its not conceptually more complex and has
negligable performance impact.
I would consider changing so that it would only load and parse, say, 4k of the
notes segment at most.
J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/