This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: What's the meaning of "Algn" in "objdump -h"?


Hi Zuxy,

> Nick Clifton wrote:
How about trying out the attached patch instead ?

Actually that version will not work, since it makes .lcomm to require a third argument. We need the third argument to be optional in order to continue to support its current usage. So please try out this revised version of the patch instead.


Cheers
  Nick


Index: gcc/config/i386/bsd.h
===================================================================
--- gcc/config/i386/bsd.h	(revision 137552)
+++ gcc/config/i386/bsd.h	(working copy)
@@ -65,6 +65,11 @@
   assemble_name ((FILE), (NAME)),		\
   fprintf ((FILE), ",%u\n", (int)(ROUNDED)))
 
+#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGNMENT)  \
+( fputs (".lcomm ", (FILE)),			\
+  assemble_name ((FILE), (NAME)),		\
+  fprintf ((FILE), ",%u,%u\n", (int)(SIZE), (int)(ALIGNMENT) / BITS_PER_UNIT))
+
 /* This is how to output an assembler line
    that says to advance the location counter
    to a multiple of 2**LOG bytes.  */
Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.344
diff -c -3 -p -r1.344 tc-i386.c
*** gas/config/tc-i386.c	3 Jun 2008 17:31:52 -0000	1.344
--- gas/config/tc-i386.c	9 Jul 2008 11:54:04 -0000
*************** static const arch_entry cpu_arch[] =
*** 684,689 ****
--- 684,731 ----
      CPU_SSE5_FLAGS },
  };
  
+ /* Like s_lcomm_internal in gas/read.c but the alignment string
+    is allowed to be optional.  */
+ 
+ static symbolS *
+ pe_lcomm_internal (int needs_align, symbolS *symbolP, addressT size)
+ {
+   addressT align = 0;
+ 
+   SKIP_WHITESPACE ();
+ 
+   if (needs_align 
+       && *input_line_pointer == ',')
+     {
+       align = parse_align (needs_align - 1);
+       
+       if (align == (addressT) -1)
+ 	return NULL;
+     }
+   else
+     {
+       if (size >= 8)
+ 	align = 3;
+       else if (size >= 4)
+ 	align = 2;
+       else if (size >= 2)
+ 	align = 1;
+       else
+ 	align = 0;
+     }
+ 
+   bss_alloc (symbolP, size, align);
+   return symbolP;
+ }
+ 
+ void pe_lcomm (int);
+ 
+ void
+ pe_lcomm (int needs_align)
+ {
+   s_comm_internal (needs_align * 2, pe_lcomm_internal);
+ }
+ 
  const pseudo_typeS md_pseudo_table[] =
  {
  #if !defined(OBJ_AOUT) && !defined(USE_ALIGN_PTWO)
*************** const pseudo_typeS md_pseudo_table[] =
*** 694,699 ****
--- 736,743 ----
    {"arch", set_cpu_arch, 0},
  #ifndef I386COFF
    {"bss", s_bss, 0},
+ #else
+   {"lcomm", pe_lcomm, 1},
  #endif
    {"ffloat", float_cons, 'f'},
    {"dfloat", float_cons, 'd'},

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]