This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

Re: Problem with gas "Error: attempt to .org backwards ignored"


Hi Peng,

>      I met a problem with gas when I do "as draw7.s -o draw7.o":
>
> draw7.s: Assembler messages:
> draw7.s:11384: Error: attempt to .org backwards ignored
>
>      I don't know what is wrong with my .s file. Any hint? Thanks.

> I tried two versions of gas, both of them spit the above error messages.
> (1) GNU assembler version 2.9-ia64-000717 (ia64-hp-linux) using BFD 
> version 2.9-ia64-000717
> (2) GNU assembler version 2.11.90.0.8 (ia64-redhat-linux) using BFD 
> version 2.11.90.0.8

Both of these versions are very old.  I would recommend that you
update your sources to the latest release (2.14) and then rebuild and
reinstall the assembler.  This will not actually solve your problem,
but it is likely to prevent you from running into other bugs.

The error message is occurring because you are trying to use the .org
directive to move the location pointer inside the .sbss section
backwards.  What is happening is this:

At line 3716 you have these lines:

	.section .sbss
	.org 0x20
	.align	0
	.type	SpLiTtEd_return_flag_callee_183, @object
	.size	SpLiTtEd_return_flag_callee_183, 4
  SpLiTtEd_return_flag_callee_183:	// 0x20
	.skip 4

This is the first declaration of an object inside the .sbss section
and it ends up leaving the location pointer at 0x28.  Then at line
11383, (the first of the errors), you have these lines:

	.section .sbss
	.org 0x0
	.align	0
	.type	LinkField0_49_24, @object
	.size	LinkField0_49_24, 8
  LinkField0_49_24:	// 0x0

Obviously the intent of this code is to move back to the start of the
.sbss section and insert the "LinkField0_49_24" label and its
contents.  GAS does not allow this however.  It is a single pass
assembler and so it does not allow the location pointer to be moved
backwards.  (Please see the assembler documentation for more
information about this).

The solution is to reorder your assembler code so that all of the
contents of the .sbss section are declared in a linear order.  ie, if
you change the lines at 3716 to look like this:

	.section .sbss
	.org 0x0
	.align	0
	.type	LinkField0_49_24, @object
	.size	LinkField0_49_24, 8
  LinkField0_49_24:	// 0x0
	.org 0x8
	.align	0
	.type	LinkField1_49_25, @object
	.size	LinkField1_49_25, 8
  LinkField1_49_25:	// 0x8
	.org 0x10
	.align	0
	.type	LinkField2_49_26, @object
	.size	LinkField2_49_26, 8
  LinkField2_49_26:	// 0x10
	.org 0x18
	.align	0
	.type	Query0_49_23, @object
	.size	Query0_49_23, 8
  Query0_49_23:	// 0x18
	.org 0x20
	.align	0
	.type	SpLiTtEd_return_flag_callee_183, @object
	.size	SpLiTtEd_return_flag_callee_183, 4
  SpLiTtEd_return_flag_callee_183:	// 0x20
	.skip 4

and the delete the lines at 11383 your program will assemble.

Cheers
        Nick


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