diff -rU10 virgin/yasm-r1818/modules/objfmts/macho/macho-objfmt.c yasm-r1818/modules/objfmts/macho/macho-objfmt.c
--- virgin/yasm-r1818/modules/objfmts/macho/macho-objfmt.c	2007-03-10 10:20:57.000000000 +0100
+++ yasm-r1818/modules/objfmts/macho/macho-objfmt.c	2007-03-12 04:52:04.000000000 +0100
@@ -1404,30 +1404,38 @@
 
     sectname = vp->val;
 
     /* translate .text,.data,.bss to __text,__data,__bss... */
     for (i=0; i<NELEMS(section_name_translation); i++) {
 	if (yasm__strcasecmp(sectname, section_name_translation[i].in) == 0)
 	    break;
     }
 
     if (i == NELEMS(section_name_translation)) {
-	yasm_warn_set(YASM_WARN_GENERAL,
-		      N_("Unknown section type, defaulting to .text"));
-	i = 0;
+        if (strlen(sectname) >= 16) {
+            yasm_error_set(YASM_ERROR_VALUE,
+                           N_("The section name `%s' is too long, max 16 chars"), 
+                           sectname);
+            return NULL;
+        }
+        f_segname = "__TEXT";
+        f_sectname = yasm__xstrdup(sectname);
+        flags = S_ATTR_SOME_INSTRUCTIONS;
+        align = 0;
+	i = -1; /* can be used as indicator further down */
+    } else {
+        f_segname = section_name_translation[i].seg;
+        f_sectname = section_name_translation[i].sect;
+        flags = section_name_translation[i].flags;
+        align = section_name_translation[i].align;
     }
 
-    f_segname = section_name_translation[i].seg;
-    f_sectname = section_name_translation[i].sect;
-    flags = section_name_translation[i].flags;
-    align = section_name_translation[i].align;
-
     while ((vp = yasm_vps_next(vp))) {
 	if (!vp->val) {
 	    yasm_warn_set(YASM_WARN_GENERAL,
 			  N_("Unrecognized numeric qualifier"));
 	    continue;
 	}
 
 	flags_override = 1;
 	if (yasm__strcasecmp(vp->val, "align") == 0 && vp->param) {
 	    /*@dependent@ *//*@null@ */ const yasm_intnum *align_expr;
@@ -1448,23 +1456,48 @@
 			       vp->val);
 		return NULL;
 	    }
 
 	    /* Check to see if alignment is supported size */
 	    if (align > 16384) {
 		yasm_error_set(YASM_ERROR_VALUE,
 		    N_("macho implementation does not support alignments > 16384"));
 		return NULL;
 	    }
-	} else
-	    yasm_warn_set(YASM_WARN_GENERAL,
-			  N_("Unrecognized qualifier `%s'"), vp->val);
+        } else if (yasm__strcasecmp(vp->val, "segname") == 0) {
+            if (vp->param) {
+                yasm_error_set(YASM_ERROR_VALUE,
+                               N_("The `segname' attribute for section `%s' has a parameter. "
+                                  "Try drop any `=' or similar between the `segname' and the name."),
+                               sectname);
+                return NULL;
+            }
+            vp = yasm_vps_next(vp);
+            if (!vp) {
+                yasm_error_set(YASM_ERROR_VALUE,
+                               N_("The `segname' attribute for section `%s' is missing the name"),
+                               sectname);
+                return NULL;
+            }
+            if (strlen(vp->val) >= 16) {
+                yasm_error_set(YASM_ERROR_VALUE,
+                               N_("The segment name `%s' for section `%s' is too long, max 16 chars"), 
+                               sectname, vp->val);
+                return NULL;
+            }
+            f_segname = yasm__xstrdup(vp->val);
+        } else {
+            yasm_error_set(YASM_ERROR_VALUE,
+	         	   N_("Unrecognized qualifier `%s' or missing parameter in the section defintion of `%s'"), 
+                           vp->val, sectname);
+            return NULL;
+        }
     }
 
     retval = yasm_object_get_general(object, sectname, 0, align, 1, resonly,
 				     &isnew, line);
 
     if (isnew)
 	msd = macho_objfmt_init_new_section(object, retval, sectname, line);
     else
 	msd = yasm_section_get_data(retval, &macho_section_data_cb);
 
Only in yasm-r1818: obj
