[hackers] [scc] [cc2-i386] Emit .extern for external variables || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Tue, 26 Jan 2016 14:32:00 +0100 (CET)

commit cbc25129f24988965a55c87501f7e36cbd6fc245
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Tue Jan 26 14:24:36 2016 +0100
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Tue Jan 26 14:24:36 2016 +0100

    [cc2-i386] Emit .extern for external variables
    
    This is not needed with gas, because it is totally stupid and
    it sets as external by default all the symbols, but it is a good
    idea to use it if we want to move to other assembler in the future.

diff --git a/cc2/arch/i386-sysv/code.c b/cc2/arch/i386-sysv/code.c
index f6c3993..7d7c4c5 100644
--- a/cc2/arch/i386-sysv/code.c
+++ b/cc2/arch/i386-sysv/code.c
_AT_@ -164,8 +164,9 @@ label(Symbol *sym)
         segment(seg);
 
         switch (sym->kind) {
- case LOCAL:
         case EXTRN:
+ printf("\t.extern\t%s\n", name);
+ case LOCAL:
                 return;
         case GLOB:
                 printf("\t.globl\t%s\n", name);
Received on Tue Jan 26 2016 - 14:32:00 CET

This archive was generated by hypermail 2.3.0 : Tue Jan 26 2016 - 14:36:14 CET