329055dbbc
Currently, nothing will stop you from re-using the same label string multiple times in a dts, e.g.: / { samelabel: prop1 = "foo"; samelabel: prop2 = "bar"; }; or / { samelabel: prop1 = "foo"; samelabel: subnode { }; }; When using node references by label, this could lead to confusing results (with no warning), and in -Oasm mode will result in output which the assembler will complain about (since it too will have duplicate labels). This patch, therefore, adds code to checks.c to give errors if you attempt to re-use the same label. It treats all labels (node, property, and value) as residing in the same namespace, since the assembler will treat them so for -Oasm mode. Testcases for the new code are also added. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
15 lines
163 B
Text
15 lines
163 B
Text
/dts-v1/;
|
|
|
|
/ {
|
|
label: property1 = "foo";
|
|
label: property2 = "bar";
|
|
|
|
test1 = &label;
|
|
|
|
label: node1 {
|
|
prop = "foo";
|
|
};
|
|
label: node2 {
|
|
prop = "bar";
|
|
};
|
|
};
|