diff --git a/livetree.c b/livetree.c index 169462d..f46a098 100644 --- a/livetree.c +++ b/livetree.c @@ -919,6 +919,12 @@ static void add_fixup_entry(struct dt_info *dti, struct node *fn, /* m->ref can only be a REF_PHANDLE, but check anyway */ assert(m->type == REF_PHANDLE); + /* The format only permits fixups for references to label, not + * references to path */ + if (strchr(m->ref, '/')) + die("Can't generate fixup for reference to path &{%s}\n", + m->ref); + /* there shouldn't be any ':' in the arguments */ if (strchr(node->fullpath, ':') || strchr(prop->name, ':')) die("arguments should not contain ':'\n"); diff --git a/tests/fixup-ref-to-path.dts b/tests/fixup-ref-to-path.dts new file mode 100644 index 0000000..f6dcba0 --- /dev/null +++ b/tests/fixup-ref-to-path.dts @@ -0,0 +1,6 @@ +/dts-v1/; +/plugin/; + +/ { + prop = < &{/path/to/node} >; +}; diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 0cabd13..244df8a 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -271,6 +271,7 @@ libfdt_overlay_tests () { run_dtc_test -I dts -O dtb -o $tree.test.dtb "$SRCDIR/$tree.dts" run_test overlay_bad_fixup overlay_base_no_symbols.test.dtb $tree.test.dtb done + run_sh_test "$SRCDIR/dtc-fatal.sh" -I dts -O dtb -o /dev/null fixup-ref-to-path.dts } # Tests to exercise dtc's overlay generation support