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. Rob -- To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html