summaryrefslogtreecommitdiff
path: root/dtc-lexer.l
diff options
context:
space:
mode:
author Fredrik Markstrom <fredrik.markstrom@gmail.com> 2018-09-24 13:27:27 +0200
committer David Gibson <david@gibson.dropbear.id.au> 2018-09-25 12:40:43 +1000
commit0fcffda15e9f4510aa8cd2a495bec66242d1898f (patch)
treea3e2c9b60af927ba8880b38835a21cc3dfc22cc7 /dtc-lexer.l
parent1e4a0928f3b3b827824222572e551a60935607e3 (diff)
Merge nodes with local target label references
This change makes sure that nodes with target label references doesn't create additional fragments if the label can been resolved locally. Target path references are not resolved locally and will generate a fragment. Previously the dts below would generate two fragments: /dts-v1/; /plugin/; &x { a: a@0 {};}; &a { b {}; }; This commit essentially reverts part of the commit "Correct overlay syntactic sugar for generating target-path fragments". The main reason we want to do this is that it breaks consumers of dtbo:s that can't resolve references between fragments in the same dtbo (like the linux 4.1 kernel). In addition creating a fragment for each label reference substantially increases the size of the resulting dtbo for some use cases. Signed-off-by: Fredrik Markstrom <fredrik.markstrom@gmail.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc-lexer.l')
-rw-r--r--dtc-lexer.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/dtc-lexer.l b/dtc-lexer.l
index 615b7ec..06c0409 100644
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -213,14 +213,14 @@ static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
<*>\&{LABEL} { /* label reference */
DPRINT("Ref: %s\n", yytext+1);
yylval.labelref = xstrdup(yytext+1);
- return DT_REF;
+ return DT_LABEL_REF;
}
<*>"&{/"{PATHCHAR}*\} { /* new-style path reference */
yytext[yyleng-1] = '\0';
DPRINT("Ref: %s\n", yytext+2);
yylval.labelref = xstrdup(yytext+2);
- return DT_REF;
+ return DT_PATH_REF;
}
<BYTESTRING>[0-9a-fA-F]{2} {