[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] symbols: avoid emitting "end" symbols for data items



commit 6eede548df21c0ed1f7fae7781805370fb024af5
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Oct 31 08:37:57 2025 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Oct 31 08:37:57 2025 +0100

    symbols: avoid emitting "end" symbols for data items
    
    symbols-dummy.c and the generated .xen-syms.?.S may place their symbols in
    different sections: Like for all C files, -fdata-sections may be in effect
    there. As a result, besides these symbols moving, there may then also be
    different amounts of "end" symbols inserted between them. While the
    movement is likely not problematic, the change in table size is - linking
    passes 2 and 3 want no address (and hence no size) changes between them.
    
    As, at least right now, the "end" symbols are useful only for code, limit
    their emission accordingly. When data symbols are emitted (i.e. when
    LIVEPATCH=y), this obviously also has a positive effect on overall table
    size (I'm seeing almost 600 entries going away in the build I'm looking
    at).
    
    Fixes: d3b637fba31b ("symbols: arrange to know where functions end")
    Reported-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Tested-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
 xen/tools/symbols.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 399edc8578..7685866b97 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -176,10 +176,9 @@ static int read_symbol(FILE *in, struct sym_entry *s)
                *sym++ = '#';
        }
        strcpy(sym, str);
-       if (sort_by_name || map_only) {
+       if (sort_by_name || map_only)
                s->orig_symbol = strdup(SYMBOL_NAME(s));
-               s->type = stype; /* As s->sym[0] ends mangled. */
-       }
+       s->type = stype; /* As s->sym[0] may end up mangled. */
        s->sym[0] = stype;
        s->typed = strcmp(type, "FUNC") == 0 ||
                   strcmp(type, "OBJECT") == 0 ||
@@ -313,6 +312,7 @@ static int compare_name_orig(const void *p1, const void *p2)
 static bool want_symbol_end(unsigned int idx)
 {
        return table[idx].size &&
+              toupper(table[idx].type) == 'T' &&
               (idx + 1 == table_cnt ||
                table[idx].addr + table[idx].size < table[idx + 1].addr);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.