inline assem problem with -fPIC gcc3.3.1

Discussion in 'C Programming' started by kscho, Oct 9, 2003.

  1. kscho

    kscho Guest

    Hi~

    When I make shared library with option -fPIC, the result is wrong and
    different
    that made static library.

    first time , I made apps with static library. code works fine.
    however when i make apps with shared library , it's not fine. but I must
    use shared library.

    My library is something about image routine(contains mmx inline assembly).

    This code is inline assem sample
    Code:
    extern const short tab_row[];
    extern const short tab_col[];
    img_mmx(short* blk)
    {
    asm volatile(
    ....
     :
     :"m"(blk), "m"(*tab_row), "m"(*tab_col)
     :"memory"
    );
    );
    
    }
    
    This is check result with nm :
    ------------------------------------------------
    with -fPIC
    Code:
               U _GLOBAL_OFFSET_TABLE
    ....000  T __i686.get_pc_thunk.bx
    ....000  T __i686.get_pc_thunk.cx
    ....324  T img_mmx
               U tab_row
               U tab_col
    
    no -fPIC
    Code:
    ....324  T img_mmx
               U tab_row
               U tab_col
    
    -------------------------------------------------------

    compile with gcc3.3.1

    I think this problem is about memory reallocation. How do i solve it?
    Anyone have a similar problem with this?

    thanks in advance
     
    kscho, Oct 9, 2003
    #1
    1. Advertising

  2. kscho

    Dan Pop Guest

    In <bm3f5c$6s6$> "kscho" <> writes:

    >When I make shared library with option -fPIC, the result is wrong and
    >different
    >that made static library.


    What was your C language question? In your opinion, what did they create
    gnu.gcc.help for?

    Dan
    --
    Dan Pop
    DESY Zeuthen, RZ group
    Email:
     
    Dan Pop, Oct 9, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rashad Rivera

    Accessing Functions in a JScript.NET assem

    Rashad Rivera, Jan 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    452
    Peter Torr \(MS\)
    Jan 20, 2004
  2. =?Utf-8?B?a2F0ZQ==?=
    Replies:
    0
    Views:
    466
    =?Utf-8?B?a2F0ZQ==?=
    Aug 25, 2005
  3. James Ying
    Replies:
    2
    Views:
    618
    James Ying
    Oct 28, 2003
  4. Philip Goisman
    Replies:
    5
    Views:
    501
    Jonathan Turkanis
    Jan 22, 2004
  5. Robbie Brown

    Compiling -fPIC from object files

    Robbie Brown, Mar 13, 2014, in forum: C Programming
    Replies:
    5
    Views:
    134
    Geoff
    Mar 13, 2014
Loading...

Share This Page