On Tue, Nov 21, 2017 at 03:06:46PM -0600, Rob Herring wrote: > On Sat, Aug 19, 2017 at 2:33 AM, David Gibson > <david@xxxxxxxxxxxxxxxxxxxxx> wrote: > > On Fri, Aug 18, 2017 at 11:02:01AM -0500, Rob Herring wrote: > >> On Thu, Aug 17, 2017 at 11:35 PM, David Gibson > >> <david@xxxxxxxxxxxxxxxxxxxxx> wrote: > >> > On Mon, Aug 14, 2017 at 04:48:06PM -0500, Rob Herring wrote: > >> > > > [...] > > >> > It does mean listing everything in the check_table which is a pain. I > >> > would really like to change things so that a single macro can both > >> > declare the check and add it to the master list, but I haven't thought > >> > of a portable way to do that so far. > >> > >> This is done in the kernel frequently using linker sections. Each > >> check entry would get put into a specific section, then you just > >> iterate through the entries. Would that work? I could imagine that > >> linker magic may not be all the portable. > > > > Right. Linker sections are the usual way to do this, but that > > requires lower level knowledge of how the toolchain works than I > > really want to put into dtc. At heart dtc is really a very > > straightforward standard C program, so I don't want to introduce > > dependencies on a specific compiler. > > To follow up on this, what about using dlopen/dlsym and having > libraries with checks? That should be fairly portable. dtc could load > checks libs from some known or env path. Each checks library would > provide some known entry point we can call for it to register its > checks. I don't immediately see how this addresses the problem. Either we'd have to have every check in a separate library, which would be pretty painful, or each library would need a list of checks, and we'd have the same issue generating it as we do already. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature