@@ -18,16 +18,17 @@
#define SYMBOL_LIMIT (1 << 12) /* 4K */
-void arch__symbols__fixup_end(struct symbol *p, struct symbol *c,
- bool is_kernel __maybe_unused)
+void arch__symbols__fixup_end(struct symbol *p, struct symbol *c, bool is_kernel)
{
- if (p->end == p->start || p->end != c->start) {
- if ((strchr(p->name, '[') && strchr(c->name, '[') == NULL) ||
- (strchr(p->name, '[') == NULL && strchr(c->name, '[')))
- /* Limit range of last symbol in module and kernel */
- p->end += SYMBOL_LIMIT;
- else
- p->end = c->start;
+ if (is_kernel && (p->end == p->start || p->end != c->start) &&
+ ((strchr(p->name, '[') && strchr(c->name, '[') == NULL) ||
+ (strchr(p->name, '[') == NULL && strchr(c->name, '[')))) {
+ /* Limit range of last symbol in module and kernel */
+ p->end += SYMBOL_LIMIT;
+ pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);
+ } else if (p->end == p->start) {
+ /* Expand empty symbols. */
+ p->end = c->start;
pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);
}
}
@@ -14,16 +14,16 @@
* Therefore do not fill this gap and do not assign it to the kernel dso map.
*/
-void arch__symbols__fixup_end(struct symbol *p, struct symbol *c,
- bool is_kernel __maybe_unused)
+void arch__symbols__fixup_end(struct symbol *p, struct symbol *c, bool is_kernel)
)
{
- if (p->end == p->start || p->end != c->start) {
- if (strchr(p->name, '[') == NULL && strchr(c->name, '['))
- /* Limit the range of last kernel symbol */
- p->end += page_size;
- else
- p->end = c->start;
- pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);
+ if (is_kernel && (p->end == p->start || p->end != c->start) &&
+ strchr(p->name, '[') == NULL && strchr(c->name, '[')) {
+ /* Limit the range of last kernel symbol */
+ p->end += page_size;
+ } else if (p->end == p->start) {
+ /* Expand empty symbols. */
+ p->end = c->start;
}
+ pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);
}
@@ -42,15 +42,16 @@ int arch__fix_module_text_start(u64 *start, u64 *size, const char *name)
* and beginning of first module's text segment is very big.
* Therefore do not fill this gap and do not assign it to the kernel dso map.
*/
-void arch__symbols__fixup_end(struct symbol *p, struct symbol *c,
- bool is_kernel __maybe_unused)
+void arch__symbols__fixup_end(struct symbol *p, struct symbol *c, bool is_kernel)
{
- if (p->end == p->start || p->end != c->start) {
- if (strchr(p->name, '[') == NULL && strchr(c->name, '['))
- /* Last kernel symbol mapped to end of page */
- p->end = roundup(p->end, page_size);
- else
- p->end = c->start;
+ if (is_kernel && (p->end == p->start || p->end != c->start) &&
+ strchr(p->name, '[') == NULL && strchr(c->name, '[')) {
+ /* Last kernel symbol mapped to end of page */
+ p->end = roundup(p->end, page_size);
+ pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);
+ } else if (p->end == p->start) {
+ /* Expand empty symbols. */
+ p->end = c->start;
pr_debug4("%s sym:%s end:%#" PRIx64 "\n", __func__, p->name, p->end);
}
}