[Bug gas/12011] New: Incorrect handling of invalid ELF section flags.

2010-09-13 Thread aburgess at broadcom dot com
The following test was on an i386 target, but the bug is not specific, most of
the targets that use md_elf_section_letter are currently broken.

Using the test program (test.s):

.section ".rodata", "z"
.global foo
foo:
.word 1

Then assemble with:

> gas -o test test.s
test.s: Assembler messages:
test.s:1: Warning: entity size for SHF_MERGE not specified
test.s:1: Warning: group name for SHF_GROUP not specified
test.s:1: Warning: setting incorrect section attributes for .rodata
/projects/firepath_work/aburgess/GNU-binutils/build/gas/as-new: test: warning:
sh_link not set for section `.rodata'

The "z" section flag is invalid, and it didn't assemble, so I got what I
deserved :) but we're not stopping with the correct error message in the correct
place. 

I've got a patch for this and will append to this defect.

-- 
   Summary: Incorrect handling of invalid ELF section flags.
   Product: binutils
   Version: unspecified
Status: NEW
  Severity: normal
  Priority: P2
 Component: gas
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: aburgess at broadcom dot com
CC: bug-binutils at gnu dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=12011

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/12011] Incorrect handling of invalid ELF section flags.

2010-09-13 Thread aburgess at broadcom dot com

--- Additional Comments From aburgess at broadcom dot com  2010-09-13 10:42 
---
Created an attachment (id=4978)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4978&action=view)
Proposed patch

The patch changes the behaviour so that md_elf_section_letter returns
(bfd_vma)-1 for error, anything else is assumed to be a flag and is merged,
this includes 0, this allows targets to ignore flags if they want (I think this
is pretty useful).

I've changed all the targets to comply, and while I was in the area I've
tweaked the error message so it includes the offending flag character, and fix
the capitalisation on the error message to match.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=12011

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/12011] Incorrect handling of invalid ELF section flags.

2010-09-13 Thread aburgess at broadcom dot com

--- Additional Comments From aburgess at broadcom dot com  2010-09-13 11:34 
---
Created an attachment (id=4979)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4979&action=view)
New test for this issue

The tar file contains a new test for this issue that could be added to the
src/gas/testsuite/gas/elf directory.
There are three new files to add bad-section-flag.{s,d,err} and a patch file
elf.exp.patch that should apply to the elf.exp file.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=12011

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.

___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils