News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

PROGBITS ??

Started by DarkWolf, March 09, 2008, 05:03:10 AM

Previous topic - Next topic

DarkWolf

Compiling code that was originally for 1.97 with 1.101 (build 13181), ld gives me the following error:

ld: section `.text' type changed to PROGBITS

It's a simple app that takes a user string and writes it to a text file.
I have been compiling it on every version of HLA I have downloaded.

What is a PROGBITS type ? (first I have seen ld return this)
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

Randall Hyde

Quote from: DarkWolf on March 09, 2008, 05:03:10 AM
Compiling code that was originally for 1.97 with 1.101 (build 13181), ld gives me the following error:

ld: section `.text' type changed to PROGBITS

It's a simple app that takes a user string and writes it to a text file.
I have been compiling it on every version of HLA I have downloaded.

What is a PROGBITS type ? (first I have seen ld return this)

Hmmm...
This is a new one to me.
Anyone else have an explanation?
hLater,
Randy Hyde

Evenbit

Using 'readelf' confirms this.  Most ELF object files have '.text' set as PROGBITS type, whereas an HLA object file has it set as NOBITS.  Apparently, ld is making an "on-the-fly" change to the section type.

Nathan.


MichaelW

I find references to progbits as an optional section type that as may set for ELF targets:

http://sourceware.org/binutils/docs-2.18/as/Section.html#Section

And as a section type used in an ld mapping directive:

http://docsrv.sco.com:507/en/topics/mapfile.map_directives.html
eschew obfuscation

Randall Hyde

Quote from: MichaelW on March 17, 2008, 07:45:14 AM
I find references to progbits as an optional section type that as may set for ELF targets:

http://sourceware.org/binutils/docs-2.18/as/Section.html#Section

And as a section type used in an ld mapping directive:

http://docsrv.sco.com:507/en/topics/mapfile.map_directives.html


Thanks for the info.
This may have cleared something up for me.
A big difference between HLA v1.97 and later versions under Linux is that v1.97 and before used (by default) Gas to process the source code emitted by HLA. HLA v1.98 and later started using the internal version of FASM to do this task. I suspect the problem is that the FASM .section directive I'm using isn't setting these @progbits flag.  Here's the FASM directive I'm using:


section .text executable align 16


Is there a FASM option that I'm missing here?
I'll post something on the FASM board if no one around here has any ideas.

Workaround: try compiling with Gas as the back-end assembler. Use an "-xg" command-line option and see if that solves the problem (HLA object files should follow the basic a.out file format, so there shouldn't be an issue with the @progbits flag).
hLater,
Randy Hyde


DarkWolf

That works.

I was still operating under the belief that I had to rename hla to fhla or use an option to use FASM and that it still used Gas under Linux by default.
I hadn't change any makefile for a couple of versions of hla but I'll try to keep them set for Gas specifically.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.