This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: linker testsuite patch...
It is the syntax used by gcc. Here is the assembler output of hello
world.
.file "hw.c"
.section .rodata
.align 2
.LC0:
.ascii "Hello world!\n\000"
.text
.align 2
.global main
.type main, function
main:
@ args = 0, pretend = 0, frame = 8
@ frame_needed = 1, uses_anonymous_args = 0
mov ip, sp
stmfd sp!, {fp, ip, lr, pc}
sub fp, ip, #4
sub sp, sp, #8
str r0, [fp, #-16]
str r1, [fp, #-20]
ldr r0, .L2
bl printf
mov r0, r3
ldmea fp, {fp, sp, pc}
.L3:
.align 2
.L2:
.word .LC0
.size main, .-main
.ident "GCC: (GNU) 3.3 20020918 (experimental)"
On Wed, 2002-11-06 at 07:24, Alan Modra wrote:
> On Wed, Nov 06, 2002 at 01:16:10AM -0500, Scott Bambrough wrote:
> > --- src.orig/ld/testsuite/ld-elfvsb/define.s Mon Nov 19 15:32:02 2001
> > +++ src/ld/testsuite/ld-elfvsb/define.s Wed Oct 30 21:01:17 2002
> > @@ -1,10 +1,10 @@
> > .data
> > .globl protected
> > - .type protected,@object
> > + .type protected, object
> > protected:
> > .globl hidden
> > - .type hidden,@object
> > + .type hidden, object
> > hidden:
> > .globl internal
> > - .type internal,@object
> > + .type internal, object
> > internal:
>
> Hmm, this is the comment in gas/config/obj-elf.c:obj_elf_type
>
> /* Handle the ELF .type pseudo-op. This sets the type of a symbol.
> There are five syntaxes:
>
> The first (used on Solaris) is
> .type SYM,#function
> The second (used on UnixWare) is
> .type SYM,@function
> The third (reportedly to be used on Irix 6.0) is
> .type SYM STT_FUNC
> The fourth (used on NetBSD/Arm and Linux/ARM) is
> .type SYM,%function
> The fifth (used on SVR4/860) is
> .type SYM,"function"
> */
>
> Seems like you've found a sixth syntax accepted by gas. ;-)
>
> --
> Alan Modra
> IBM OzLabs - Linux Technology Centre
--
Scott Bambrough <sbambrough@storm.ca>