]> granicus.if.org Git - yasm/commitdiff
Merge [2114] and [2115] from trunk (Fix #148, clearing of GAS elf sectflags).
authorPeter Johnson <peter@tortall.net>
Wed, 8 Oct 2008 07:34:51 +0000 (07:34 -0000)
committerPeter Johnson <peter@tortall.net>
Wed, 8 Oct 2008 07:34:51 +0000 (07:34 -0000)
svn path=/branches/yasm-0.7.x/; revision=2145

modules/dbgfmts/dwarf2/tests/pass64/dwarf64_leb128.hex
modules/objfmts/elf/elf-objfmt.c
modules/objfmts/elf/tests/gas64/crosssect.hex
modules/objfmts/elf/tests/gas64/elf_gas64_curpos.hex

index af09833caf60cd7f7c3af6976c9725bb9ae4deb6..562eadb63aa8759a6bcd44dc392c7d4228090530 100644 (file)
@@ -90134,7 +90134,7 @@ c0
 00 
 00 
 00 
-00 
+02 
 00 
 00 
 00 
index 3756df304b8f38b89146aeeeb4e78f45ef20c844..f48a4aafb7fcba93a8b56937a8260f218e53bc17 100644 (file)
@@ -962,6 +962,7 @@ struct elf_section_switch_data {
     unsigned long flags;
     unsigned long type;
     int gasflags;
+    int stdsect;
 };
 
 /* GAS-style flags */
@@ -979,6 +980,11 @@ elf_helper_gasflags(void *obj, yasm_valparam *vp, unsigned long line, void *d,
         return -1;
     }
 
+    if (data->stdsect && strlen(s) == 0) {
+        data->gasflags = 1;
+        return 0;
+    }
+
     data->flags = 0;
     for (i=0; i<strlen(s); i++) {
         switch (s[i]) {
@@ -1064,6 +1070,7 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams,
     data.flags = SHF_ALLOC;
     data.type = SHT_PROGBITS;
     data.gasflags = 0;
+    data.stdsect = 1;
 
     vp = yasm_vps_first(valparams);
     sectname = yasm_vp_string(vp);
@@ -1095,6 +1102,7 @@ elf_objfmt_section_switch(yasm_object *object, yasm_valparamhead *valparams,
     } else {
         /* Default to code */
         align = 1;
+        data.stdsect = 0;
     }
 
     flags_override = yasm_dir_helper(object, vp, line, help, NELEMS(help),
index 4e15f9370bc827853a6f4fcac531eedfc0ada685..dd95c79db34378d78617b854e3cd4925b4fc320a 100644 (file)
@@ -774,7 +774,7 @@ e4
 00 
 00 
 00 
-00 
+02 
 00 
 00 
 00 
index f1a2befa8e5923a4ff52ebdef8c0c72c0ac72068..80e25a8f38ee4df9f3957992d5abae920afd25dc 100644 (file)
@@ -870,7 +870,7 @@ c0
 00 
 00 
 00 
-00 
+06 
 00 
 00 
 00 
@@ -1126,7 +1126,7 @@ b4
 00 
 00 
 00 
-00 
+03 
 00 
 00 
 00