diff options
| author | William Wilgus <me.theuser@yahoo.com> | 2019-07-17 00:39:14 -0500 |
|---|---|---|
| committer | William Wilgus <me.theuser@yahoo.com> | 2019-07-27 14:30:45 +0200 |
| commit | e1475a38ef89ef7bb36aeb1238bf5f7d139b78e2 (patch) | |
| tree | bf4c87039e552ac92a140f96d23156bdf37f734a /apps/plugin.c | |
| parent | 321de68b216400d3542e34d9c64c4aa261e60341 (diff) | |
| download | rockbox-e1475a38ef89ef7bb36aeb1238bf5f7d139b78e2.zip rockbox-e1475a38ef89ef7bb36aeb1238bf5f7d139b78e2.tar.gz rockbox-e1475a38ef89ef7bb36aeb1238bf5f7d139b78e2.tar.bz2 rockbox-e1475a38ef89ef7bb36aeb1238bf5f7d139b78e2.tar.xz | |
Fix non aligned crashes with tlsf
When the starting address of the plugin buffer
is not aligned to 8 bytes crashes occur in tlsf
(on ARM atleast)
Change-Id: I655500c25e1c8f84b4a2418e9ec5c5948e4bea82
Diffstat (limited to 'apps/plugin.c')
| -rw-r--r-- | apps/plugin.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 41434f2..3c957b4 100644 --- a/apps/plugin.c +++ b/apps/plugin.c @@ -921,7 +921,8 @@ int plugin_load(const char* plugin, const void* parameter) return -1; } #if (CONFIG_PLATFORM & PLATFORM_NATIVE) - plugin_size = hdr->end_addr - pluginbuf; + /* tlsf crashes observed on arm with 0x4 aligned addresses */ + plugin_size = ALIGN_UP(hdr->end_addr - pluginbuf, 0x8); #else plugin_size = 0; #endif |