[Top][All Lists]

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

Re: [Tinycc-devel] Unify C and asm symbols

From: Michael Matz
Subject: Re: [Tinycc-devel] Unify C and asm symbols
Date: Tue, 5 Dec 2017 00:06:31 +0100 (CET)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)


On Mon, 4 Dec 2017, Michael Matz wrote:

> Oh, shiny! :)  I like it.  It also works on my linux kernel sources, and 
> some other things, so it's a definite improvement.  I'd say, apply.

Bleh, I wanted to ask one thing about the no_asmstack patch, the hunk:

@@ -390,7 +388,7 @@ ST_FUNC int find_elf_sym(Section *s, const char *name)
     while (sym_index != 0) {
         sym = &((ElfW(Sym) *)s->data)[sym_index];
         name1 = (char *) s->link->data + sym->st_name;
-        if (!strcmp(name, name1))
+        if (!strcmp(name, name1) && ELFW(ST_BIND)(sym->st_info) != STB_LOCAL)
             return sym_index;
         sym_index = ((int *)hs->data)[2 + nbuckets + sym_index];

My tests go through also without this hunk, so it's either an optimization 
(but then it should be tested before the strcmp) or it's a left-over from 
during development of your patch, or it's for a situation I don't know yet 
(perhaps one of the multi-file ones?)

Conceptually it makes sense of course: STB_LOCAL symbols should be bound 
via the Sym structure (i.e. within a file), not be used for providing 
resolution for symbols from other files, but still I'm curious why you 
needed it.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]