[Patch]: aix/xcoff: add a check for invalid .stabx

Tristan Gingold gingold@adacore.com
Tue Mar 29 12:36:00 GMT 2011


Hi,

the following input:

	.csect .text[PR]
	.stabx	"name___XR_R117b___XEXA:V322=&22",-1,133,0

crashes gas because this .stabx in not within .bs/.es

Instead of crashing, this patch emits an error message.

Ok for trunk ?

Tristan.

gas/
2011-03-29  Tristan Gingold  <gingold@adacore.com>

	* config/tc-ppc.c (ppc_stabx): Add a check.


diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 4396e14..1bbaa63 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -3749,6 +3749,9 @@ ppc_stabx (int ignore ATTRIBUTE_UNUSED)
 
   if (S_GET_STORAGE_CLASS (sym) == C_STSYM) {
 
+    if (ppc_current_block == NULL)
+      as_bad (_(".stabx of storage class stsym must be within .bs/.es"));
+
     symbol_get_tc (sym)->within = ppc_current_block;
 
     /* In this case :



More information about the Binutils mailing list