This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-fleading-underscore is not working as expected.


Dear All ,

Was enabled the switch  "-fleading-underscore"  to emit the global
symbol name with prefix _ .

The respective C source file

int a=10;

int b=10,c;

int test()

{

        c =a+b ;

        tes();

        return c ;

}

and respective asm file

.global _a

        .section        .data

        .align  1

        .type   _a, %object

        .size   _a, 2

_a:

        .word   10

        .global _b

        .align  1

        .type   _b, %object

        .size   _b, 2

_b:

        .word   10

        .comm   _c, 2,2

        .section        .text

        .align  1

        .global _test

        .type   _test, %function

_test:

        ld      HL, (a)

        ld      DE, (b)

        add     DE, HL

        ld      (c), DE

        cal     _tes

        ld      DE, (c)

        ld      WA, DE

        ret


if you see the asm ,the global symbol names was prefixed with _ in the
definition ,But not in the uses.

I'm sure we are missing something here w.r.t -fleading-underscore flag
and gcc source is 4.8.1.

Any help will be appreciated here .

Thank you
~Umesh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]