GNU Assembler

GNU Assembler

Post by George Bel » Sat, 22 Dec 2001 06:43:20



I've seen several references to "assembly" and the GNU "assembler" related
to the process of building from sources.  I understand the compilation and
linking part, but I'm not sure about the "assembly" part.  This has
something to do with shared libraries?  I take it this has nothing to do
with the assembler programming language.

_________________________________________________________________________
George Bell/   |   "Doug, you're suffering from a schizoid embolism!"
Arlington/ VA  |   <Coffee && Doughnuts

 
 
 

GNU Assembler

Post by Grant Edwar » Sat, 22 Dec 2001 06:49:21



> I've seen several references to "assembly" and the GNU
> "assembler" related to the process of building from sources.  I
> understand the compilation and linking part, but I'm not sure
> about the "assembly" part.  This has something to do with
> shared libraries?

No, not really.

Quote:> I take it this has nothing to do with the assembler programming
> language.

Yes, it does.  The Gnu assembler (do a 'man as') is what
processes the assembly language files generated by either you
(if you write a program in assembly language) or gcc (if you
compile a program with gcc).

--
Grant Edwards                   grante             Yow!  Why don't you
                                  at               ever enter and CONTESTS,
                               visi.com            Marvin?? Don't you know
                                                   your own ZIPCODE?

 
 
 

GNU Assembler

Post by Tauno Voipi » Sat, 22 Dec 2001 18:57:04



Quote:> I've seen several references to "assembly" and the GNU "assembler" related
> to the process of building from sources.  I understand the compilation and
> linking part, but I'm not sure about the "assembly" part.

The GNU compilers produce assembly language which is then converted to
symbolic binary files (object modules) by the assembler. The symbolic binary
files are linked together to produce the runnable binary files.

Quote:>  This has
> something to do with shared libraries?  I take it this has nothing to do
> with the assembler programming language.

Wrong. The assembly language modules are essential in the compiling and
linking process. (See above).

The shared libraries are runnable modules with certain function entry points
preserved. Due to the memory address allocation issues, the libraries are
compiled into position-independent code, so they can reside at different
addresses in the address spaces of different processes at the same time. The
linker constructs the references to the shared library entries but it does
not include the library code in the run modules.

Tauno Voipio

 
 
 

1. GNU assembler to Solaris assembler

I would like to covert one inline assembly function included in SPARC
Linux to Solaris assembler syntax. The function is written in GNU
assembler syntax.
Two syntax errors are reported due to pseudo operators when I compile
using gcc on Solaris.

inline void spin_lock(unsigned char *lock)
{
  __asm__ __volatile__("
1:  ldstub  [%0], %%g2
  orcc  %%g2, 0x0, %%g0
  bne,a 2f
   ldub [%0], %%g2
  .text 2                         <==
2:  orcc  %%g2, 0x0, %%g0
  bne,a 2b
   ldub [%0], %%g2
  b,a 1b
        .previous                       <==
" :
  : "r" (lock)
  : "g2", "memory", "cc");

/usr/ccs/bin/as: "/var/tmp/cc030Gpt.s", line 18: error: quoted-string operand required
/usr/ccs/bin/as: "/var/tmp/cc030Gpt.s", line 23: error: unknown opcode ".previous"
/usr/ccs/bin/as: "/var/tmp/cc030Gpt.s", line 23: error: statement syntax

How can I convert the function to Solaris assembler syntax? In
particular I cannot find '.previous' pseudo operator in GNU assembler
info manual.
I have confirmed that gcc + GNU assembler can compile this function on
Solaris.

    <--------->    Computational Science Laboratory
                   The Institute of Physics and Chemistry(RIKEN)
    >---------<    Susukita Ryutaro

2. dlq 0.50 - idle-line download queue

3. How to wait for input and giving prompt at a regular interval

4. GNU assembler 2.5.2.6

5. Read if you want your CDU31A/33A to keep working...

6. GNU assembler release now folded into "binary utilities" package

7. compiling apache/mod_ssl/php on rh7.2

8. GNU assembler

9. HELP - need basic info on GNU assembler

10. Doc on GNU ASSEMBLER

11. Gnu-Assembler documentation?

12. help with as , the GNU assembler !