diff options
author | SzuWei Lin <szuweilin@google.com> | 2017-03-28 17:14:56 +0800 |
---|---|---|
committer | SzuWei Lin <szuweilin@google.com> | 2017-03-29 13:29:48 +0800 |
commit | 3407a9c362f9c3930c68ab0548184a8215a9f8bd (patch) | |
tree | 87a6b48e7a711c5772d809c6d72a1ec307ee7706 /sysdeps | |
parent | 523ab1c32a3ec29b74b53430bd0abfea71e91aee (diff) | |
download | libufdt-3407a9c362f9c3930c68ab0548184a8215a9f8bd.tar.gz |
Fix the problem of not enough merged dtb size
The dtc has suffix compression for string, ex. "a_string", "string"
and "ing", these strings could share a same string in dtb
string table. libufdt assumes the merged dtb size shouldn't larger
than the summary size of base and overlay dtb, and doesn't
apply the same compression.
The patch add a test case for this case and fix the problem.
Bug: 35255584
Test: tests/run_tests.sh
Change-Id: I6bac1e2823ca90dbdb852452544c41ab040a5ccc
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/include/libufdt_sysdeps.h | 2 | ||||
-rw-r--r-- | sysdeps/libufdt_sysdeps_posix.c | 4 | ||||
-rw-r--r-- | sysdeps/libufdt_sysdeps_vendor.c | 4 |
3 files changed, 10 insertions, 0 deletions
diff --git a/sysdeps/include/libufdt_sysdeps.h b/sysdeps/include/libufdt_sysdeps.h index c2682c7..fb5584f 100644 --- a/sysdeps/include/libufdt_sysdeps.h +++ b/sysdeps/include/libufdt_sysdeps.h @@ -48,6 +48,8 @@ unsigned long int dto_strtoul(const char *nptr, char **endptr, int base); size_t dto_strlen(const char *s); +int dto_memcmp(const void *lhs, const void *rhs, size_t n); + void *dto_memcpy(void *dest, const void *src, size_t n); int dto_strcmp(const char *s1, const char *s2); diff --git a/sysdeps/libufdt_sysdeps_posix.c b/sysdeps/libufdt_sysdeps_posix.c index c8a08f6..d7a198f 100644 --- a/sysdeps/libufdt_sysdeps_posix.c +++ b/sysdeps/libufdt_sysdeps_posix.c @@ -36,6 +36,10 @@ unsigned long int dto_strtoul(const char *nptr, char **endptr, int base) { size_t dto_strlen(const char *s) { return strlen(s); } +int dto_memcmp(const void *lhs, const void *rhs, size_t n) { + return memcmp(lhs, rhs, n); +} + void *dto_memcpy(void *dest, const void *src, size_t n) { return memcpy(dest, src, n); } diff --git a/sysdeps/libufdt_sysdeps_vendor.c b/sysdeps/libufdt_sysdeps_vendor.c index e21a2e1..12e7695 100644 --- a/sysdeps/libufdt_sysdeps_vendor.c +++ b/sysdeps/libufdt_sysdeps_vendor.c @@ -194,6 +194,10 @@ unsigned long int dto_strtoul(const char *nptr, char **endptr, int base) { size_t dto_strlen(const char *s) { return strlen(s); } +int dto_memcmp(const void *lhs, const void *rhs, size_t n) { + return memcmp(lhs, rhs, n); +} + void *dto_memcpy(void *dest, const void *src, size_t n) { return memcpy(dest, src, n); } |