Author Topic: segment attributes specified on redeclaration  (Read 19185 times)

mene mene tekel

  • Guest
segment attributes specified on redeclaration
« on: December 16, 2008, 04:47:39 PM »
Hi,

I compose my final asm file using some include files, some of them define segments like

segment .data  data  public use32 align=1 class=DATA

This way the composed file contains multiple statements like this and the compiler correctly say:

warning: segment attributes specified on redeclaration of segment: ignoring

I don't like these warnings looking for a solution without creating a lot of stupid segment names and then finally group them into a segment group.

Any idea for that?

Thanks
Martin

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: segment attributes specified on redeclaration
« Reply #1 on: December 16, 2008, 05:14:33 PM »
Hi Martin,

I thought that was fixed... guess not...

The attributes in a section declaration are "sticky". If you can arrange for Nasm to *first* see "section .data some attributes", subsequent "section .data"s will have the same attributes, without any whining from Nasm. That's how I deal with it. The only "trick" is that the declaration with the attributes has to come first! Dunno if that will help you any...

Best,
Frank

maybe:

%ifdef GOT_SECTION_ATTRIBUTES
 section .data
%elif
 section .data use32 ; etc...
 %define GOT_SECTION_ATTRIBUTES
%endif

???

mene mene tekel

  • Guest
Re: segment attributes specified on redeclaration
« Reply #2 on: December 16, 2008, 08:59:46 PM »
Yess, it works!
Many thanks,
Martin