When building Linux kernel 2.6.23, I got pageattr.s: Assembler messages: pageattr.s:219: Error: bad expression pageattr.s:219: Error: junk at end of line, first unrecognized character is `a' pageattr.s:239: Error: bad expression pageattr.s:239: Error: junk at end of line, first unrecognized character is `a' pageattr.s:502: Error: bad expression pageattr.s:502: Error: junk at end of line, first unrecognized character is `a' pageattr.s:519: Error: bad expression pageattr.s:519: Error: junk at end of line, first unrecognized character is `a' pageattr.s:540: Error: bad expression pageattr.s:540: Error: junk at end of line, first unrecognized character is `a' pageattr.s:594: Error: bad expression pageattr.s:594: Error: junk at end of line, first unrecognized character is `a' pageattr.s:619: Error: bad expression pageattr.s:619: Error: junk at end of line, first unrecognized character is `a' pageattr.s:641: Error: bad expression pageattr.s:641: Error: junk at end of line, first unrecognized character is `a' It may be introduced by http://sourceware.org/ml/binutils/2007-10/msg00178.html
bash-3.2$ cat x.s .text movl (%rbx), %eax 1: ud2 .pushsection __bug_table,"a" 2: .quad 1b, .LC0 .word 136, 0 .org 2b+24 .popsection .L21: jmp .L21 bash-3.2$ gcc -c x.s x.s: Assembler messages: x.s:4: Error: bad expression x.s:4: Error: junk at end of line, first unrecognized character is `a' bash-3.2$
Hi H.J. The test case (and presumably the pageattr.s source file) are broken. The .pushsection pseudo-op takes a subsection number as its optional second argument. Using a string is incorrect. Hence I do not think that this is a real bug. Cheers Nick
For ELF, you can specify flags, type and others with .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]] .subsection also should support them. The previous assembler did. The previous manual had ---- 7.81 `.pushsection NAME , SUBSECTION' ===================================== This is one of the ELF section stack manipulation directives. The others are `.section' (*note Section::), `.subsection' (*note SubSection::), `.popsection' (*note PopSection::), and `.previous' (*note Previous::). This directive pushes the current section (and subsection) onto the top of the section stack, and then replaces the current section and subsection with `name' and `subsection'. ---- I believe it should be .pushsection NAME [, SUBSECTION[, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]]]
A patch is posted at http://sourceware.org/ml/binutils/2007-10/msg00364.html
Fixed.