Menu

#161 ELF: Allow overriding parameters on the standard sections

open
None
7
2009-01-17
2009-01-15
Igor
No

NASM v 2.02 on FreeBSD 7.0 produces incorrectly aligned ELF output. When I say "section .text align=32" and watch output file by "readelf -S" I see .text section having alignment 32; when I say "section .data align = 32" or "section .bss align=32" I see both .data and .bss sections having alignment 4. When I use section names .data1 and .bss1, NASM sets their alignments precisely as I say it in the source.

Discussion

  • H. Peter Anvin

    H. Peter Anvin - 2009-01-16
    • labels: 563216 -->
    • priority: 5 --> 7
    • summary: doesn't honor alignment in .data and .bss sections --> ELF: Allow overriding parameters on the standard sections
     
  • H. Peter Anvin

    H. Peter Anvin - 2009-01-16

    NASM doesn't let you set the attributes of the standard section names. This is a long-standing bug in the ELF backend.

     
  • Anonymous

    Anonymous - 2009-01-17

    It may have been true at one time that alignment could not be specified by the user for standard section names, but I have just tested both ELF32 and ELF64, and they both worked properly -- at least with Linux. However, the parsing is overly strict. "align=32" works, but "align =32" and "align= 32" both fail silently.

    It is also possible that the FreeBSD linker has its own ideas about what the section alignment should be, and I would like to know if the "readelf -S" command was run against the object file, or the executable file.

     
  • Anonymous

    Anonymous - 2009-01-17
    • assigned_to: nobody --> ccrayne
     
  • H. Peter Anvin

    H. Peter Anvin - 2009-01-18

    Perhaps the Original Poster can try 2.06rc2 and see if the problem persists?

     

Log in to post a comment.