Blame SOURCES/binutils-x86-JCC-Errata.patch

fac4ff
diff -rupN binutils.orig/gas/config/tc-i386.c binutils-2.30/gas/config/tc-i386.c
fac4ff
--- binutils.orig/gas/config/tc-i386.c	2019-11-20 10:59:21.586883777 +0000
fac4ff
+++ binutils-2.30/gas/config/tc-i386.c	2019-11-20 15:25:34.197910787 +0000
fac4ff
@@ -392,6 +392,9 @@ struct _i386_insn
fac4ff
 
fac4ff
     /* Error message.  */
fac4ff
     enum i386_error error;
fac4ff
+
fac4ff
+    /* Has GOTPC relocation.  */
fac4ff
+    bfd_boolean has_gotpc_reloc;
fac4ff
   };
fac4ff
 
fac4ff
 typedef struct _i386_insn i386_insn;
fac4ff
@@ -521,6 +524,8 @@ static enum flag_code flag_code;
fac4ff
 static unsigned int object_64bit;
fac4ff
 static unsigned int disallow_64bit_reloc;
fac4ff
 static int use_rela_relocations = 0;
fac4ff
+/* __tls_get_addr/___tls_get_addr symbol for TLS.  */
fac4ff
+static const char *tls_get_addr;
fac4ff
 
fac4ff
 #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \
fac4ff
      || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) \
fac4ff
@@ -584,6 +589,21 @@ static int omit_lock_prefix = 0;
fac4ff
    "lock addl $0, (%{re}sp)".  */
fac4ff
 static int avoid_fence = 0;
fac4ff
 
fac4ff
+/* Type of the previous instruction.  */
fac4ff
+static struct
fac4ff
+{
fac4ff
+  segT seg;
fac4ff
+  const char *file;
fac4ff
+  const char *name;
fac4ff
+  unsigned int line;
fac4ff
+  enum last_insn_kind
fac4ff
+    {
fac4ff
+      last_insn_other = 0,
fac4ff
+      last_insn_directive,
fac4ff
+      last_insn_prefix
fac4ff
+    } kind;
fac4ff
+} last_insn;
fac4ff
+
fac4ff
 /* 1 if the assembler should generate relax relocations.  */
fac4ff
 
fac4ff
 static int generate_relax_relocations
fac4ff
@@ -597,6 +617,31 @@ static enum check_kind
fac4ff
   }
fac4ff
 sse_check, operand_check = check_warning;
fac4ff
 
fac4ff
+/* Non-zero if branches should be aligned within power of 2 boundary.  */
fac4ff
+static int align_branch_power = 0;
fac4ff
+
fac4ff
+/* Types of branches to align.  */
fac4ff
+enum align_branch_kind
fac4ff
+  {
fac4ff
+    align_branch_none = 0,
fac4ff
+    align_branch_jcc = 1 << 0,
fac4ff
+    align_branch_fused = 1 << 1,
fac4ff
+    align_branch_jmp = 1 << 2,
fac4ff
+    align_branch_call = 1 << 3,
fac4ff
+    align_branch_indirect = 1 << 4,
fac4ff
+    align_branch_ret = 1 << 5
fac4ff
+  };
fac4ff
+
fac4ff
+static unsigned int align_branch = (align_branch_jcc
fac4ff
+				    | align_branch_fused
fac4ff
+				    | align_branch_jmp);
fac4ff
+
fac4ff
+/* The maximum padding size for fused jcc.  */
fac4ff
+#define MAX_FUSED_JCC_PADDING_SIZE 20
fac4ff
+
fac4ff
+/* The maximum number of prefixes added for an instruction.  */
fac4ff
+static unsigned int align_branch_prefix_size = 5;
fac4ff
+
fac4ff
 /* Register prefix used for error message.  */
fac4ff
 static const char *register_prefix = "%";
fac4ff
 
fac4ff
@@ -677,12 +722,19 @@ int x86_cie_data_alignment;
fac4ff
 /* Interface to relax_segment.
fac4ff
    There are 3 major relax states for 386 jump insns because the
fac4ff
    different types of jumps add different sizes to frags when we're
fac4ff
-   figuring out what sort of jump to choose to reach a given label.  */
fac4ff
+   figuring out what sort of jump to choose to reach a given label.
fac4ff
+
fac4ff
+   BRANCH_PADDING, BRANCH_PREFIX and FUSED_JCC_PADDING are used to align
fac4ff
+   branches which are handled by md_estimate_size_before_relax() and
fac4ff
+   i386_generic_table_relax_frag().  */
fac4ff
 
fac4ff
 /* Types.  */
fac4ff
 #define UNCOND_JUMP 0
fac4ff
 #define COND_JUMP 1
fac4ff
 #define COND_JUMP86 2
fac4ff
+#define BRANCH_PADDING 3
fac4ff
+#define BRANCH_PREFIX 4
fac4ff
+#define FUSED_JCC_PADDING 5
fac4ff
 
fac4ff
 /* Sizes.  */
fac4ff
 #define CODE16	1
fac4ff
@@ -1402,7 +1454,9 @@ i386_align_code (fragS *fragP, int count
fac4ff
 		    patt [padding - 1], padding);
fac4ff
 	}
fac4ff
     }
fac4ff
-  fragP->fr_var = count;
fac4ff
+
fac4ff
+  if (fragP->fr_type != rs_machine_dependent)
fac4ff
+    fragP->fr_var = count;
fac4ff
 }
fac4ff
 
fac4ff
 static INLINE int
fac4ff
@@ -2807,6 +2861,11 @@ md_begin (void)
fac4ff
       x86_dwarf2_return_column = 8;
fac4ff
       x86_cie_data_alignment = -4;
fac4ff
     }
fac4ff
+
fac4ff
+  /* NB: FUSED_JCC_PADDING frag must have sufficient room so that it
fac4ff
+     can be turned into BRANCH_PREFIX frag.  */
fac4ff
+  if (align_branch_prefix_size > MAX_FUSED_JCC_PADDING_SIZE)
fac4ff
+    abort ();
fac4ff
 }
fac4ff
 
fac4ff
 void
fac4ff
@@ -3929,6 +3988,17 @@ md_assemble (char *line)
fac4ff
 
fac4ff
   /* We are ready to output the insn.  */
fac4ff
   output_insn ();
fac4ff
+
fac4ff
+  last_insn.seg = now_seg;
fac4ff
+
fac4ff
+  if (i.tm.opcode_modifier.isprefix)
fac4ff
+    {
fac4ff
+      last_insn.kind = last_insn_prefix;
fac4ff
+      last_insn.name = i.tm.name;
fac4ff
+      last_insn.file = as_where (&last_insn.line);
fac4ff
+    }
fac4ff
+  else
fac4ff
+    last_insn.kind = last_insn_other;
fac4ff
 }
fac4ff
 
fac4ff
 static char *
fac4ff
@@ -7162,11 +7232,202 @@ output_interseg_jump (void)
fac4ff
   md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2);
fac4ff
 }
fac4ff
 
fac4ff
+/* Return TRUE for test, and, cmp, add, sub, inc and dec which may
fac4ff
+   be macro-fused with conditional jumps.  */
fac4ff
+
fac4ff
+static bfd_boolean
fac4ff
+maybe_fused_with_jcc_p (void)
fac4ff
+{
fac4ff
+  /* No RIP address.  */
fac4ff
+  if (i.base_reg && i.base_reg->reg_num == RegRip)
fac4ff
+    return FALSE;
fac4ff
+
fac4ff
+  /* and, add, sub with destination register.  */
fac4ff
+  if (!strcmp (i.tm.name, "and")
fac4ff
+      || !strcmp (i.tm.name, "add")
fac4ff
+      || !strcmp (i.tm.name, "sub"))
fac4ff
+    return i.types[1].bitfield.reg;
fac4ff
+
fac4ff
+  /* test, cmp with any register.  */
fac4ff
+  if (!strcmp (i.tm.name, "test") || !strcmp (i.tm.name, "cmp"))
fac4ff
+    return (i.types[0].bitfield.reg
fac4ff
+	    || i.types[1].bitfield.reg);
fac4ff
+
fac4ff
+  /* inc, dec with 16/32/64-bit register.   */
fac4ff
+  if (!strcmp (i.tm.name, "inc") || !strcmp (i.tm.name, "dec"))
fac4ff
+    return i.types[0].bitfield.reg;
fac4ff
+
fac4ff
+  return FALSE;
fac4ff
+}
fac4ff
+
fac4ff
+/* Return TRUE if a FUSED_JCC_PADDING frag should be generated.  */
fac4ff
+
fac4ff
+static bfd_boolean
fac4ff
+add_fused_jcc_padding_frag_p (void)
fac4ff
+{
fac4ff
+  if (!align_branch_power
fac4ff
+      || now_seg == absolute_section
fac4ff
+      || !cpu_arch_flags.bitfield.cpui386
fac4ff
+      || !(align_branch & align_branch_fused))
fac4ff
+    return FALSE;
fac4ff
+
fac4ff
+  if (maybe_fused_with_jcc_p ())
fac4ff
+    {
fac4ff
+      if (last_insn.kind != last_insn_other
fac4ff
+	  && last_insn.seg == now_seg)
fac4ff
+	{
fac4ff
+	  if (flag_debug)
fac4ff
+	    as_warn_where (last_insn.file, last_insn.line,
fac4ff
+			   _("`%s` skips -malign-branch-boundary on `%s`"),
fac4ff
+			   last_insn.name, i.tm.name);
fac4ff
+	  return FALSE;
fac4ff
+	}
fac4ff
+      return TRUE;
fac4ff
+    }
fac4ff
+
fac4ff
+  return FALSE;
fac4ff
+}
fac4ff
+
fac4ff
+/* Return TRUE if a BRANCH_PREFIX frag should be generated.  */
fac4ff
+
fac4ff
+static bfd_boolean
fac4ff
+add_branch_prefix_frag_p (void)
fac4ff
+{
fac4ff
+  if (!align_branch_power
fac4ff
+      || now_seg == absolute_section
fac4ff
+      || i.tm.cpu_flags.bitfield.cpupadlock
fac4ff
+      || !cpu_arch_flags.bitfield.cpui386)
fac4ff
+    return FALSE;
fac4ff
+
fac4ff
+  /* Don't add prefix if it is a prefix or there is no operand.  */
fac4ff
+  if (!i.operands || i.tm.opcode_modifier.isprefix)
fac4ff
+    return FALSE;
fac4ff
+
fac4ff
+  if (last_insn.kind != last_insn_other
fac4ff
+      && last_insn.seg == now_seg)
fac4ff
+    {
fac4ff
+      if (flag_debug)
fac4ff
+	as_warn_where (last_insn.file, last_insn.line,
fac4ff
+		       _("`%s` skips -malign-branch-boundary on `%s`"),
fac4ff
+		       last_insn.name, i.tm.name);
fac4ff
+      return FALSE;
fac4ff
+    }
fac4ff
+
fac4ff
+  return TRUE;
fac4ff
+}
fac4ff
+
fac4ff
+/* Return TRUE if a BRANCH_PADDING frag should be generated.  */
fac4ff
+
fac4ff
+static int
fac4ff
+add_branch_padding_frag_p (enum align_branch_kind *branch_p)
fac4ff
+{
fac4ff
+  bfd_boolean add_padding;
fac4ff
+
fac4ff
+  if (!align_branch_power
fac4ff
+      || now_seg == absolute_section
fac4ff
+      || !cpu_arch_flags.bitfield.cpui386)
fac4ff
+    return FALSE;
fac4ff
+
fac4ff
+  add_padding = FALSE;
fac4ff
+
fac4ff
+  /* Check for jcc and direct jmp.  */
fac4ff
+  if (i.tm.opcode_modifier.jump)
fac4ff
+    {
fac4ff
+      if (i.tm.base_opcode == JUMP_PC_RELATIVE)
fac4ff
+	{
fac4ff
+	  *branch_p = align_branch_jmp;
fac4ff
+	  add_padding = align_branch & align_branch_jmp;
fac4ff
+	}
fac4ff
+      else
fac4ff
+	{
fac4ff
+	  *branch_p = align_branch_jcc;
fac4ff
+	  if ((align_branch & align_branch_jcc))
fac4ff
+	    add_padding = TRUE;
fac4ff
+	}
fac4ff
+    }
fac4ff
+  else if (i.tm.base_opcode == 0xc2
fac4ff
+	   || i.tm.base_opcode == 0xc3
fac4ff
+	   || i.tm.base_opcode == 0xca
fac4ff
+	   || i.tm.base_opcode == 0xcb)
fac4ff
+    {
fac4ff
+      *branch_p = align_branch_ret;
fac4ff
+      if ((align_branch & align_branch_ret))
fac4ff
+	add_padding = TRUE;
fac4ff
+    }
fac4ff
+  else
fac4ff
+    {
fac4ff
+      if (i.tm.base_opcode == 0xe8)
fac4ff
+	{
fac4ff
+	  *branch_p = align_branch_call;
fac4ff
+	  if ((align_branch & align_branch_call))
fac4ff
+	    add_padding = TRUE;
fac4ff
+	}
fac4ff
+      else if (i.tm.base_opcode == 0xff
fac4ff
+	       && (i.rm.reg == 2 || i.rm.reg == 4))
fac4ff
+	{
fac4ff
+	  *branch_p = align_branch_indirect;
fac4ff
+	  if ((align_branch & align_branch_indirect))
fac4ff
+	    add_padding = TRUE;
fac4ff
+	}
fac4ff
+
fac4ff
+      /* Check for indirect jmp, direct and indirect calls.  */
fac4ff
+      if (add_padding
fac4ff
+	  && i.disp_operands
fac4ff
+	  && tls_get_addr
fac4ff
+	  && (i.op[0].disps->X_op == O_symbol
fac4ff
+	      || (i.op[0].disps->X_op == O_subtract
fac4ff
+		  && i.op[0].disps->X_op_symbol == GOT_symbol)))
fac4ff
+	{
fac4ff
+	  symbolS *s = i.op[0].disps->X_add_symbol;
fac4ff
+	  /* No padding to call to global or undefined tls_get_addr.  */
fac4ff
+	  if ((S_IS_EXTERNAL (s) || !S_IS_DEFINED (s))
fac4ff
+	      && strcmp (S_GET_NAME (s), tls_get_addr) == 0)
fac4ff
+	    return FALSE;
fac4ff
+	}
fac4ff
+    }
fac4ff
+
fac4ff
+  if (add_padding
fac4ff
+      && last_insn.kind != last_insn_other
fac4ff
+      && last_insn.seg == now_seg)
fac4ff
+    {
fac4ff
+      if (flag_debug)
fac4ff
+	as_warn_where (last_insn.file, last_insn.line,
fac4ff
+		       _("`%s` skips -malign-branch-boundary on `%s`"),
fac4ff
+		       last_insn.name, i.tm.name);
fac4ff
+      return FALSE;
fac4ff
+    }
fac4ff
+
fac4ff
+  return add_padding;
fac4ff
+}
fac4ff
+
fac4ff
+static unsigned int
fac4ff
+encoding_length (const fragS *start_frag, offsetT start_off,
fac4ff
+		 const char *frag_now_ptr)
fac4ff
+{
fac4ff
+  unsigned int len = 0;
fac4ff
+
fac4ff
+  if (start_frag != frag_now)
fac4ff
+    {
fac4ff
+      const fragS *fr = start_frag;
fac4ff
+
fac4ff
+      do
fac4ff
+	{
fac4ff
+	  len += fr->fr_fix;
fac4ff
+	  fr = fr->fr_next;
fac4ff
+	}
fac4ff
+      while (fr && fr != frag_now);
fac4ff
+    }
fac4ff
+
fac4ff
+  return len - start_off + (frag_now_ptr - frag_now->fr_literal);
fac4ff
+}
fac4ff
+
fac4ff
 static void
fac4ff
 output_insn (void)
fac4ff
 {
fac4ff
   fragS *insn_start_frag;
fac4ff
   offsetT insn_start_off;
fac4ff
+  fragS *fragP = NULL;
fac4ff
+  enum align_branch_kind branch = align_branch_none;
fac4ff
 
fac4ff
   /* Tie dwarf2 debug info to the address at the start of the insn.
fac4ff
      We can't do this after the insn has been output as the current
fac4ff
@@ -7176,6 +7437,30 @@ output_insn (void)
fac4ff
   insn_start_frag = frag_now;
fac4ff
   insn_start_off = frag_now_fix ();
fac4ff
 
fac4ff
+  if (add_branch_padding_frag_p (&branch))
fac4ff
+    {
fac4ff
+      char *p;
fac4ff
+      unsigned int max_branch_padding_size = 14;
fac4ff
+
fac4ff
+      /* Align section to boundary.  */
fac4ff
+      record_alignment (now_seg, align_branch_power);
fac4ff
+
fac4ff
+      /* Make room for padding.  */
fac4ff
+      frag_grow (max_branch_padding_size);
fac4ff
+
fac4ff
+      /* Start of the padding.  */
fac4ff
+      p = frag_more (0);
fac4ff
+
fac4ff
+      fragP = frag_now;
fac4ff
+
fac4ff
+      frag_var (rs_machine_dependent, max_branch_padding_size, 0,
fac4ff
+		ENCODE_RELAX_STATE (BRANCH_PADDING, 0),
fac4ff
+		NULL, 0, p);
fac4ff
+
fac4ff
+      fragP->tc_frag_data.branch_type = branch;
fac4ff
+      fragP->tc_frag_data.max_bytes = max_branch_padding_size;
fac4ff
+    }
fac4ff
+
fac4ff
   /* Output jumps.  */
fac4ff
   if (i.tm.opcode_modifier.jump)
fac4ff
     output_branch ();
fac4ff
@@ -7217,6 +7502,44 @@ output_insn (void)
fac4ff
 	  i.prefix[LOCK_PREFIX] = 0;
fac4ff
 	}
fac4ff
 
fac4ff
+      if (branch)
fac4ff
+	/* Skip if this is a branch.  */
fac4ff
+	;
fac4ff
+      else if (add_fused_jcc_padding_frag_p ())
fac4ff
+	{
fac4ff
+	  unsigned int max_fused_padding_size
fac4ff
+	    = MAX_FUSED_JCC_PADDING_SIZE;
fac4ff
+
fac4ff
+	  /* Make room for padding.  */
fac4ff
+	  frag_grow (max_fused_padding_size);
fac4ff
+	  p = frag_more (0);
fac4ff
+
fac4ff
+	  fragP = frag_now;
fac4ff
+
fac4ff
+	  frag_var (rs_machine_dependent, max_fused_padding_size, 0,
fac4ff
+		    ENCODE_RELAX_STATE (FUSED_JCC_PADDING, 0),
fac4ff
+		    NULL, 0, p);
fac4ff
+
fac4ff
+	  fragP->tc_frag_data.branch_type = align_branch_fused;
fac4ff
+	  fragP->tc_frag_data.max_bytes = max_fused_padding_size;
fac4ff
+	}
fac4ff
+      else if (add_branch_prefix_frag_p ())
fac4ff
+	{
fac4ff
+	  unsigned int max_prefix_size = align_branch_prefix_size;
fac4ff
+
fac4ff
+	  /* Make room for padding.  */
fac4ff
+	  frag_grow (max_prefix_size);
fac4ff
+	  p = frag_more (0);
fac4ff
+
fac4ff
+	  fragP = frag_now;
fac4ff
+
fac4ff
+	  frag_var (rs_machine_dependent, max_prefix_size, 0,
fac4ff
+		    ENCODE_RELAX_STATE (BRANCH_PREFIX, 0),
fac4ff
+		    NULL, 0, p);
fac4ff
+
fac4ff
+	  fragP->tc_frag_data.max_bytes = max_prefix_size;
fac4ff
+	}
fac4ff
+
fac4ff
       /* Since the VEX/EVEX prefix contains the implicit prefix, we
fac4ff
 	 don't need the explicit prefix.  */
fac4ff
       if (!i.tm.opcode_modifier.vex && !i.tm.opcode_modifier.evex)
fac4ff
@@ -7358,6 +7681,83 @@ check_prefix:
fac4ff
 
fac4ff
       if (i.imm_operands)
fac4ff
 	output_imm (insn_start_frag, insn_start_off);
fac4ff
+
fac4ff
+      if (now_seg != absolute_section)
fac4ff
+	{
fac4ff
+	  j = encoding_length (insn_start_frag, insn_start_off, frag_more (0));
fac4ff
+	  if (fragP)
fac4ff
+	    {
fac4ff
+	      /* NB: Don't add prefix with GOTPC relocation since
fac4ff
+		 output_disp() above depends on the fixed encoding
fac4ff
+		 length.  */
fac4ff
+	      unsigned int max = i.has_gotpc_reloc ? 0 : 15 - j;
fac4ff
+	      /* Prefix count on the current instruction.  */
fac4ff
+	      unsigned int count = 0;
fac4ff
+	      unsigned int k;
fac4ff
+	      for (k = 0; k < ARRAY_SIZE (i.prefix); k++)
fac4ff
+		if (i.prefix[k])
fac4ff
+		  count++;
fac4ff
+
fac4ff
+	      /* NB: prefix count + instruction size must be <= 15.  */
fac4ff
+	      if (j > 15)
fac4ff
+		as_fatal (_("instruction length of %u bytes exceeds the limit of 15"),
fac4ff
+			  j);
fac4ff
+
fac4ff
+	      if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype)
fac4ff
+		  == BRANCH_PREFIX)
fac4ff
+		{
fac4ff
+		  /* Set the maximum prefix size in BRANCH_PREFIX
fac4ff
+		     frag.  */
fac4ff
+		  if (fragP->tc_frag_data.max_bytes > max)
fac4ff
+		    fragP->tc_frag_data.max_bytes = max;
fac4ff
+		  if (fragP->tc_frag_data.max_bytes > count)
fac4ff
+		    fragP->tc_frag_data.max_bytes -= count;
fac4ff
+		  else
fac4ff
+		    fragP->tc_frag_data.max_bytes = 0;
fac4ff
+		}
fac4ff
+	      else
fac4ff
+		{
fac4ff
+		  /* Remember the maximum prefix size in FUSED_JCC_PADDING
fac4ff
+		     frag.  */
fac4ff
+		  unsigned int max_prefix_size;
fac4ff
+		  if (align_branch_prefix_size > max)
fac4ff
+		    max_prefix_size = max;
fac4ff
+		  else
fac4ff
+		    max_prefix_size = align_branch_prefix_size;
fac4ff
+		  if (max_prefix_size > count)
fac4ff
+		    fragP->tc_frag_data.max_prefix_length
fac4ff
+		      = max_prefix_size - count;
fac4ff
+		}
fac4ff
+
fac4ff
+	      /* Use existing segment prefix if possible.  Use CS
fac4ff
+		 segment prefix in 64-bit mode.  In 32-bit mode, use SS
fac4ff
+		 segment prefix with ESP/EBP base register and use DS
fac4ff
+		 segment prefix without ESP/EBP base register.  */
fac4ff
+	      if (i.prefix[SEG_PREFIX])
fac4ff
+		fragP->tc_frag_data.default_prefix = i.prefix[SEG_PREFIX];
fac4ff
+	      else if (flag_code == CODE_64BIT)
fac4ff
+		fragP->tc_frag_data.default_prefix = CS_PREFIX_OPCODE;
fac4ff
+	      else if (i.base_reg
fac4ff
+		       && (i.base_reg->reg_num == 4
fac4ff
+			   || i.base_reg->reg_num == 5))
fac4ff
+		fragP->tc_frag_data.default_prefix = SS_PREFIX_OPCODE;
fac4ff
+	      else
fac4ff
+		fragP->tc_frag_data.default_prefix = DS_PREFIX_OPCODE;
fac4ff
+	    }
fac4ff
+	  else if (j > 15)
fac4ff
+	    as_warn (_("instruction length of %u bytes exceeds the limit of 15"),
fac4ff
+		     j);
fac4ff
+	}
fac4ff
+    }
fac4ff
+
fac4ff
+  if (align_branch_power
fac4ff
+      && now_seg != absolute_section
fac4ff
+      && cpu_arch_flags.bitfield.cpui386)
fac4ff
+    {
fac4ff
+      /* Terminate each frag so that we can add prefix and check for
fac4ff
+         fused jcc.  */
fac4ff
+      frag_wane (frag_now);
fac4ff
+      frag_new (0);
fac4ff
     }
fac4ff
 
fac4ff
 #ifdef DEBUG386
fac4ff
@@ -7484,6 +7884,7 @@ output_disp (fragS *insn_start_frag, off
fac4ff
 		    {
fac4ff
 		      reloc_type = BFD_RELOC_386_GOTPC;
fac4ff
 		      i.op[n].imms->X_add_number += add;
fac4ff
+		      i.has_gotpc_reloc = TRUE;
fac4ff
 		    }
fac4ff
 		  else if (reloc_type == BFD_RELOC_64)
fac4ff
 		    reloc_type = BFD_RELOC_X86_64_GOTPC64;
fac4ff
@@ -7649,6 +8050,7 @@ output_imm (fragS *insn_start_frag, offs
fac4ff
 		    reloc_type = BFD_RELOC_X86_64_GOTPC32;
fac4ff
 		  else if (size == 8)
fac4ff
 		    reloc_type = BFD_RELOC_X86_64_GOTPC64;
fac4ff
+		  i.has_gotpc_reloc = TRUE;
fac4ff
 		  i.op[n].imms->X_add_number += add;
fac4ff
 		}
fac4ff
 	      fix_new_exp (frag_now, p - frag_now->fr_literal, size,
fac4ff
@@ -9264,6 +9666,355 @@ elf_symbol_resolved_in_segment_p (symbol
fac4ff
 }
fac4ff
 #endif
fac4ff
 
fac4ff
+/* Return the next non-empty frag.  */
fac4ff
+
fac4ff
+static fragS *
fac4ff
+i386_next_non_empty_frag (fragS *fragP)
fac4ff
+{
fac4ff
+  /* There may be a frag with a ".fill 0" when there is no room in
fac4ff
+     the current frag for frag_grow in output_insn.  */
fac4ff
+  for (fragP = fragP->fr_next;
fac4ff
+       (fragP != NULL
fac4ff
+	&& fragP->fr_type == rs_fill
fac4ff
+	&& fragP->fr_fix == 0);
fac4ff
+       fragP = fragP->fr_next)
fac4ff
+    ;
fac4ff
+  return fragP;
fac4ff
+}
fac4ff
+
fac4ff
+/* Return the next jcc frag after BRANCH_PADDING.  */
fac4ff
+
fac4ff
+static fragS *
fac4ff
+i386_next_jcc_frag (fragS *fragP)
fac4ff
+{
fac4ff
+  if (!fragP)
fac4ff
+    return NULL;
fac4ff
+
fac4ff
+  if (fragP->fr_type == rs_machine_dependent
fac4ff
+      && (TYPE_FROM_RELAX_STATE (fragP->fr_subtype)
fac4ff
+	  == BRANCH_PADDING))
fac4ff
+    {
fac4ff
+      fragP = i386_next_non_empty_frag (fragP);
fac4ff
+      if (fragP->fr_type != rs_machine_dependent)
fac4ff
+	return NULL;
fac4ff
+      if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == COND_JUMP)
fac4ff
+	return fragP;
fac4ff
+    }
fac4ff
+
fac4ff
+  return NULL;
fac4ff
+}
fac4ff
+
fac4ff
+/* Classify BRANCH_PADDING, BRANCH_PREFIX and FUSED_JCC_PADDING frags.  */
fac4ff
+
fac4ff
+static void
fac4ff
+i386_classify_machine_dependent_frag (fragS *fragP)
fac4ff
+{
fac4ff
+  fragS *cmp_fragP;
fac4ff
+  fragS *pad_fragP;
fac4ff
+  fragS *branch_fragP;
fac4ff
+  fragS *next_fragP;
fac4ff
+  unsigned int max_prefix_length;
fac4ff
+
fac4ff
+  if (fragP->tc_frag_data.classified)
fac4ff
+    return;
fac4ff
+
fac4ff
+  /* First scan for BRANCH_PADDING and FUSED_JCC_PADDING.  Convert
fac4ff
+     FUSED_JCC_PADDING and merge BRANCH_PADDING.  */
fac4ff
+  for (next_fragP = fragP;
fac4ff
+       next_fragP != NULL;
fac4ff
+       next_fragP = next_fragP->fr_next)
fac4ff
+    {
fac4ff
+      next_fragP->tc_frag_data.classified = 1;
fac4ff
+      if (next_fragP->fr_type == rs_machine_dependent)
fac4ff
+	switch (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype))
fac4ff
+	  {
fac4ff
+	  case BRANCH_PADDING:
fac4ff
+	    /* The BRANCH_PADDING frag must be followed by a branch
fac4ff
+	       frag.  */
fac4ff
+	    branch_fragP = i386_next_non_empty_frag (next_fragP);
fac4ff
+	    next_fragP->tc_frag_data.u.branch_fragP = branch_fragP;
fac4ff
+	    break;
fac4ff
+	  case FUSED_JCC_PADDING:
fac4ff
+	    /* Check if this is a fused jcc:
fac4ff
+	       FUSED_JCC_PADDING
fac4ff
+	       CMP
fac4ff
+	       BRANCH_PADDING
fac4ff
+	       COND_JUMP
fac4ff
+	       */
fac4ff
+	    cmp_fragP = i386_next_non_empty_frag (next_fragP);
fac4ff
+	    pad_fragP = i386_next_non_empty_frag (cmp_fragP);
fac4ff
+	    branch_fragP = i386_next_jcc_frag (pad_fragP);
fac4ff
+	    if (branch_fragP)
fac4ff
+	      {
fac4ff
+		/* The BRANCH_PADDING frag is merged with the
fac4ff
+		   FUSED_JCC_PADDING frag.  */
fac4ff
+		next_fragP->tc_frag_data.u.branch_fragP = branch_fragP;
fac4ff
+		/* CMP instruction size.  */
fac4ff
+		next_fragP->tc_frag_data.cmp_size = cmp_fragP->fr_fix;
fac4ff
+		frag_wane (pad_fragP);
fac4ff
+		/* Skip to branch_fragP.  */
fac4ff
+		next_fragP = branch_fragP;
fac4ff
+	      }
fac4ff
+	    else if (next_fragP->tc_frag_data.max_prefix_length)
fac4ff
+	      {
fac4ff
+		/* Turn FUSED_JCC_PADDING into BRANCH_PREFIX if it isn't
fac4ff
+		   a fused jcc.  */
fac4ff
+		next_fragP->fr_subtype
fac4ff
+		  = ENCODE_RELAX_STATE (BRANCH_PREFIX, 0);
fac4ff
+		next_fragP->tc_frag_data.max_bytes
fac4ff
+		  = next_fragP->tc_frag_data.max_prefix_length;
fac4ff
+		/* This will be updated in the BRANCH_PREFIX scan.  */
fac4ff
+		next_fragP->tc_frag_data.max_prefix_length = 0;
fac4ff
+	      }
fac4ff
+	    else
fac4ff
+	      frag_wane (next_fragP);
fac4ff
+	    break;
fac4ff
+	  }
fac4ff
+    }
fac4ff
+
fac4ff
+  /* Scan for BRANCH_PREFIX.  */
fac4ff
+  for (; fragP != NULL; fragP = fragP->fr_next)
fac4ff
+    if (fragP->fr_type == rs_machine_dependent
fac4ff
+	&& (TYPE_FROM_RELAX_STATE (fragP->fr_subtype)
fac4ff
+	    == BRANCH_PREFIX))
fac4ff
+      {
fac4ff
+	/* Count all BRANCH_PREFIX frags before BRANCH_PADDING and
fac4ff
+	   COND_JUMP_PREFIX.  */
fac4ff
+	max_prefix_length = 0;
fac4ff
+	for (next_fragP = fragP;
fac4ff
+	     next_fragP != NULL;
fac4ff
+	     next_fragP = next_fragP->fr_next)
fac4ff
+	  {
fac4ff
+	    if (next_fragP->fr_type == rs_fill)
fac4ff
+	      /* Skip rs_fill frags.  */
fac4ff
+	      ;
fac4ff
+	    else if (next_fragP->fr_type == rs_machine_dependent)
fac4ff
+	      {
fac4ff
+		if (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype)
fac4ff
+		    == BRANCH_PREFIX)
fac4ff
+		  {
fac4ff
+		    /* Count BRANCH_PREFIX frags.  */
fac4ff
+		    if (max_prefix_length >= MAX_FUSED_JCC_PADDING_SIZE)
fac4ff
+		      {
fac4ff
+			max_prefix_length = MAX_FUSED_JCC_PADDING_SIZE;
fac4ff
+			frag_wane (next_fragP);
fac4ff
+		      }
fac4ff
+		    else
fac4ff
+		      max_prefix_length
fac4ff
+			+= next_fragP->tc_frag_data.max_bytes;
fac4ff
+		  }
fac4ff
+		else if ((TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype)
fac4ff
+			  == BRANCH_PADDING)
fac4ff
+			 || (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype)
fac4ff
+			     == FUSED_JCC_PADDING))
fac4ff
+		  {
fac4ff
+		    /* Stop at BRANCH_PADDING and FUSED_JCC_PADDING.  */
fac4ff
+		    fragP->tc_frag_data.u.padding_fragP = next_fragP;
fac4ff
+		    break;
fac4ff
+		  }
fac4ff
+		else
fac4ff
+		  /* Stop for other rs_machine_dependent frags.  */
fac4ff
+		  break;
fac4ff
+	      }
fac4ff
+	    else
fac4ff
+	      /* Stop for all other frags.  */
fac4ff
+	      break;
fac4ff
+	  }
fac4ff
+
fac4ff
+	fragP->tc_frag_data.max_prefix_length = max_prefix_length;
fac4ff
+
fac4ff
+	/* Skip to the next frag.  */
fac4ff
+	fragP = next_fragP;
fac4ff
+      }
fac4ff
+}
fac4ff
+
fac4ff
+/* Compute padding size for
fac4ff
+
fac4ff
+	FUSED_JCC_PADDING
fac4ff
+	CMP
fac4ff
+	BRANCH_PADDING
fac4ff
+	COND_JUMP/UNCOND_JUMP
fac4ff
+
fac4ff
+   or
fac4ff
+
fac4ff
+	BRANCH_PADDING
fac4ff
+	COND_JUMP/UNCOND_JUMP
fac4ff
+ */
fac4ff
+
fac4ff
+static int
fac4ff
+i386_branch_padding_size (fragS *fragP, offsetT address)
fac4ff
+{
fac4ff
+  unsigned int offset, size, padding_size;
fac4ff
+  fragS *branch_fragP = fragP->tc_frag_data.u.branch_fragP;
fac4ff
+
fac4ff
+  /* The start address of the BRANCH_PADDING or FUSED_JCC_PADDING frag.  */
fac4ff
+  if (!address)
fac4ff
+    address = fragP->fr_address;
fac4ff
+  address += fragP->fr_fix;
fac4ff
+
fac4ff
+  /* CMP instrunction size.  */
fac4ff
+  size = fragP->tc_frag_data.cmp_size;
fac4ff
+
fac4ff
+  /* The base size of the branch frag.  */
fac4ff
+  size += branch_fragP->fr_fix;
fac4ff
+
fac4ff
+  /* Add opcode and displacement bytes for the rs_machine_dependent
fac4ff
+     branch frag.  */
fac4ff
+  if (branch_fragP->fr_type == rs_machine_dependent)
fac4ff
+    size += md_relax_table[branch_fragP->fr_subtype].rlx_length;
fac4ff
+
fac4ff
+  /* Check if branch is within boundary and doesn't end at the last
fac4ff
+     byte.  */
fac4ff
+  offset = address & ((1U << align_branch_power) - 1);
fac4ff
+  if ((offset + size) >= (1U << align_branch_power))
fac4ff
+    /* Padding needed to avoid crossing boundary.  */
fac4ff
+    padding_size = (1 << align_branch_power) - offset;
fac4ff
+  else
fac4ff
+    /* No padding needed.  */
fac4ff
+    padding_size = 0;
fac4ff
+
fac4ff
+  if (!fits_in_signed_byte (padding_size))
fac4ff
+    abort ();
fac4ff
+
fac4ff
+  return padding_size;
fac4ff
+}
fac4ff
+
fac4ff
+/* i386_generic_table_relax_frag()
fac4ff
+
fac4ff
+   Handle BRANCH_PADDING, BRANCH_PREFIX and FUSED_JCC_PADDING frags to
fac4ff
+   grow/shrink padding to align branch frags.  Hand others to
fac4ff
+   relax_frag().  */
fac4ff
+
fac4ff
+long
fac4ff
+i386_generic_table_relax_frag (segT segment, fragS *fragP, long stretch)
fac4ff
+{
fac4ff
+  if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PADDING
fac4ff
+      || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == FUSED_JCC_PADDING)
fac4ff
+    {
fac4ff
+      long padding_size = i386_branch_padding_size (fragP, 0);
fac4ff
+      long grow = padding_size - fragP->tc_frag_data.length;
fac4ff
+
fac4ff
+      /* When the BRANCH_PREFIX frag is used, the computed address
fac4ff
+         must match the actual address and there should be no padding.  */
fac4ff
+      if (fragP->tc_frag_data.padding_address
fac4ff
+	  && (fragP->tc_frag_data.padding_address != fragP->fr_address
fac4ff
+	      || padding_size))
fac4ff
+	abort ();
fac4ff
+
fac4ff
+      /* Update the padding size.  */
fac4ff
+      if (grow)
fac4ff
+	fragP->tc_frag_data.length = padding_size;
fac4ff
+
fac4ff
+      return grow;
fac4ff
+    }
fac4ff
+  else if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX)
fac4ff
+    {
fac4ff
+      fragS *padding_fragP, *next_fragP;
fac4ff
+      long padding_size, left_size, last_size;
fac4ff
+
fac4ff
+      padding_fragP = fragP->tc_frag_data.u.padding_fragP;
fac4ff
+      if (!padding_fragP)
fac4ff
+	/* Use the padding set by the leading BRANCH_PREFIX frag.  */
fac4ff
+	return (fragP->tc_frag_data.length
fac4ff
+		- fragP->tc_frag_data.last_length);
fac4ff
+
fac4ff
+      /* Compute the relative address of the padding frag in the very
fac4ff
+        first time where the BRANCH_PREFIX frag sizes are zero.  */
fac4ff
+      if (!fragP->tc_frag_data.padding_address)
fac4ff
+	fragP->tc_frag_data.padding_address
fac4ff
+	  = padding_fragP->fr_address - (fragP->fr_address - stretch);
fac4ff
+
fac4ff
+      /* First update the last length from the previous interation.  */
fac4ff
+      left_size = fragP->tc_frag_data.prefix_length;
fac4ff
+      for (next_fragP = fragP;
fac4ff
+	   next_fragP != padding_fragP;
fac4ff
+	   next_fragP = next_fragP->fr_next)
fac4ff
+	if (next_fragP->fr_type == rs_machine_dependent
fac4ff
+	    && (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype)
fac4ff
+		== BRANCH_PREFIX))
fac4ff
+	  {
fac4ff
+	    if (left_size)
fac4ff
+	      {
fac4ff
+		int max = next_fragP->tc_frag_data.max_bytes;
fac4ff
+		if (max)
fac4ff
+		  {
fac4ff
+		    int size;
fac4ff
+		    if (max > left_size)
fac4ff
+		      size = left_size;
fac4ff
+		    else
fac4ff
+		      size = max;
fac4ff
+		    left_size -= size;
fac4ff
+		    next_fragP->tc_frag_data.last_length = size;
fac4ff
+		  }
fac4ff
+	      }
fac4ff
+	    else
fac4ff
+	      next_fragP->tc_frag_data.last_length = 0;
fac4ff
+	  }
fac4ff
+
fac4ff
+      /* Check the padding size for the padding frag.  */
fac4ff
+      padding_size = i386_branch_padding_size
fac4ff
+	(padding_fragP, (fragP->fr_address
fac4ff
+			 + fragP->tc_frag_data.padding_address));
fac4ff
+
fac4ff
+      last_size = fragP->tc_frag_data.prefix_length;
fac4ff
+      /* Check if there is change from the last interation.  */
fac4ff
+      if (padding_size == last_size)
fac4ff
+	{
fac4ff
+	  /* Update the expected address of the padding frag.  */
fac4ff
+	  padding_fragP->tc_frag_data.padding_address
fac4ff
+	    = (fragP->fr_address + padding_size
fac4ff
+	       + fragP->tc_frag_data.padding_address);
fac4ff
+	  return 0;
fac4ff
+	}
fac4ff
+
fac4ff
+      if (padding_size > fragP->tc_frag_data.max_prefix_length)
fac4ff
+	{
fac4ff
+	  /* No padding if there is no sufficient room.  Clear the
fac4ff
+	     expected address of the padding frag.  */
fac4ff
+	  padding_fragP->tc_frag_data.padding_address = 0;
fac4ff
+	  padding_size = 0;
fac4ff
+	}
fac4ff
+      else
fac4ff
+	/* Store the expected address of the padding frag.  */
fac4ff
+	padding_fragP->tc_frag_data.padding_address
fac4ff
+	  = (fragP->fr_address + padding_size
fac4ff
+	     + fragP->tc_frag_data.padding_address);
fac4ff
+
fac4ff
+      fragP->tc_frag_data.prefix_length = padding_size;
fac4ff
+
fac4ff
+      /* Update the length for the current interation.  */
fac4ff
+      left_size = padding_size;
fac4ff
+      for (next_fragP = fragP;
fac4ff
+	   next_fragP != padding_fragP;
fac4ff
+	   next_fragP = next_fragP->fr_next)
fac4ff
+	if (next_fragP->fr_type == rs_machine_dependent
fac4ff
+	    && (TYPE_FROM_RELAX_STATE (next_fragP->fr_subtype)
fac4ff
+		== BRANCH_PREFIX))
fac4ff
+	  {
fac4ff
+	    if (left_size)
fac4ff
+	      {
fac4ff
+		int max = next_fragP->tc_frag_data.max_bytes;
fac4ff
+		if (max)
fac4ff
+		  {
fac4ff
+		    int size;
fac4ff
+		    if (max > left_size)
fac4ff
+		      size = left_size;
fac4ff
+		    else
fac4ff
+		      size = max;
fac4ff
+		    left_size -= size;
fac4ff
+		    next_fragP->tc_frag_data.length = size;
fac4ff
+		  }
fac4ff
+	      }
fac4ff
+	    else
fac4ff
+	      next_fragP->tc_frag_data.length = 0;
fac4ff
+	  }
fac4ff
+
fac4ff
+      return (fragP->tc_frag_data.length
fac4ff
+	      - fragP->tc_frag_data.last_length);
fac4ff
+    }
fac4ff
+  return relax_frag (segment, fragP, stretch);
fac4ff
+}
fac4ff
+
fac4ff
 /* md_estimate_size_before_relax()
fac4ff
 
fac4ff
    Called just before relax() for rs_machine_dependent frags.  The x86
fac4ff
@@ -9280,6 +10031,14 @@ elf_symbol_resolved_in_segment_p (symbol
fac4ff
 int
fac4ff
 md_estimate_size_before_relax (fragS *fragP, segT segment)
fac4ff
 {
fac4ff
+  if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PADDING
fac4ff
+      || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX
fac4ff
+      || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == FUSED_JCC_PADDING)
fac4ff
+    {
fac4ff
+      i386_classify_machine_dependent_frag (fragP);
fac4ff
+      return fragP->tc_frag_data.length;
fac4ff
+    }
fac4ff
+
fac4ff
   /* We've already got fragP->fr_subtype right;  all we have to do is
fac4ff
      check for un-relaxable symbols.  On an ELF system, we can't relax
fac4ff
      an externally visible symbol, because it may be overridden by a
fac4ff
@@ -9409,6 +10168,109 @@ md_convert_frag (bfd *abfd ATTRIBUTE_UNU
fac4ff
   unsigned int extension = 0;
fac4ff
   offsetT displacement_from_opcode_start;
fac4ff
 
fac4ff
+  if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PADDING
fac4ff
+      || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == FUSED_JCC_PADDING
fac4ff
+      || TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX)
fac4ff
+    {
fac4ff
+      /* Generate nop padding.  */
fac4ff
+      unsigned int size = fragP->tc_frag_data.length;
fac4ff
+
fac4ff
+      if (size == 0)
fac4ff
+	return;
fac4ff
+
fac4ff
+      if (size > fragP->tc_frag_data.max_bytes)
fac4ff
+	abort ();
fac4ff
+
fac4ff
+      if (flag_debug)
fac4ff
+	{
fac4ff
+	  const char *msg;
fac4ff
+	  const char *branch = "branch";
fac4ff
+	  const char *prefix = "";
fac4ff
+	  fragS *padding_fragP;
fac4ff
+
fac4ff
+	  if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype)
fac4ff
+	      == BRANCH_PREFIX)
fac4ff
+	    {
fac4ff
+	      padding_fragP = fragP->tc_frag_data.u.padding_fragP;
fac4ff
+	      switch (fragP->tc_frag_data.default_prefix)
fac4ff
+		{
fac4ff
+		default:
fac4ff
+		  abort ();
fac4ff
+		  break;
fac4ff
+		case CS_PREFIX_OPCODE:
fac4ff
+		  prefix = " cs";
fac4ff
+		  break;
fac4ff
+		case DS_PREFIX_OPCODE:
fac4ff
+		  prefix = " ds";
fac4ff
+		  break;
fac4ff
+		case ES_PREFIX_OPCODE:
fac4ff
+		  prefix = " es";
fac4ff
+		  break;
fac4ff
+		case FS_PREFIX_OPCODE:
fac4ff
+		  prefix = " fs";
fac4ff
+		  break;
fac4ff
+		case GS_PREFIX_OPCODE:
fac4ff
+		  prefix = " gs";
fac4ff
+		  break;
fac4ff
+		case SS_PREFIX_OPCODE:
fac4ff
+		  prefix = " ss";
fac4ff
+		  break;
fac4ff
+		}
fac4ff
+	      if (padding_fragP)
fac4ff
+		msg = _("%s:%u: add %d%s at 0x%llx to align "
fac4ff
+			"%s within %d-byte boundary\n");
fac4ff
+	      else
fac4ff
+		msg = _("%s:%u: add additional %d%s at 0x%llx to "
fac4ff
+			"align %s within %d-byte boundary\n");
fac4ff
+	    }
fac4ff
+	  else
fac4ff
+	    {
fac4ff
+	      padding_fragP = fragP;
fac4ff
+	      msg = _("%s:%u: add %d%s-byte nop at 0x%llx to align "
fac4ff
+		      "%s within %d-byte boundary\n");
fac4ff
+	    }
fac4ff
+
fac4ff
+	  if (padding_fragP)
fac4ff
+	    switch (padding_fragP->tc_frag_data.branch_type)
fac4ff
+	      {
fac4ff
+	      case align_branch_jcc:
fac4ff
+		branch = "jcc";
fac4ff
+		break;
fac4ff
+	      case align_branch_fused:
fac4ff
+		branch = "fused jcc";
fac4ff
+		break;
fac4ff
+	      case align_branch_jmp:
fac4ff
+		branch = "jmp";
fac4ff
+		break;
fac4ff
+	      case align_branch_call:
fac4ff
+		branch = "call";
fac4ff
+		break;
fac4ff
+	      case align_branch_indirect:
fac4ff
+		branch = "indiret branch";
fac4ff
+		break;
fac4ff
+	      case align_branch_ret:
fac4ff
+		branch = "ret";
fac4ff
+		break;
fac4ff
+	      default:
fac4ff
+		break;
fac4ff
+	      }
fac4ff
+
fac4ff
+	  fprintf (stdout, msg,
fac4ff
+		   fragP->fr_file, fragP->fr_line, size, prefix,
fac4ff
+		   (long long) fragP->fr_address, branch,
fac4ff
+		   1 << align_branch_power);
fac4ff
+	}
fac4ff
+
fac4ff
+      if (TYPE_FROM_RELAX_STATE (fragP->fr_subtype) == BRANCH_PREFIX)
fac4ff
+	memset (fragP->fr_opcode,
fac4ff
+		fragP->tc_frag_data.default_prefix, size);
fac4ff
+      else
fac4ff
+	i386_align_code (fragP, size);
fac4ff
+      fragP->fr_fix += size;
fac4ff
+
fac4ff
+      return;
fac4ff
+    }
fac4ff
+
fac4ff
   opcode = (unsigned char *) fragP->fr_opcode;
fac4ff
 
fac4ff
   /* Address we want to reach in file space.  */
fac4ff
@@ -9963,6 +10825,10 @@ const char *md_shortopts = "qn";
fac4ff
 #define OPTION_MINTEL64 (OPTION_MD_BASE + 23)
fac4ff
 #define OPTION_MFENCE_AS_LOCK_ADD (OPTION_MD_BASE + 24)
fac4ff
 #define OPTION_MRELAX_RELOCATIONS (OPTION_MD_BASE + 25)
fac4ff
+#define OPTION_MALIGN_BRANCH_BOUNDARY (OPTION_MD_BASE + 27)
fac4ff
+#define OPTION_MALIGN_BRANCH_PREFIX_SIZE (OPTION_MD_BASE + 28)
fac4ff
+#define OPTION_MALIGN_BRANCH (OPTION_MD_BASE + 29)
fac4ff
+#define OPTION_MBRANCHES_WITH_32B_BOUNDARIES (OPTION_MD_BASE + 30)
fac4ff
 
fac4ff
 struct option md_longopts[] =
fac4ff
 {
fac4ff
@@ -9997,6 +10863,10 @@ struct option md_longopts[] =
fac4ff
   {"mfence-as-lock-add", required_argument, NULL, OPTION_MFENCE_AS_LOCK_ADD},
fac4ff
   {"mrelax-relocations", required_argument, NULL, OPTION_MRELAX_RELOCATIONS},
fac4ff
   {"mevexrcig", required_argument, NULL, OPTION_MEVEXRCIG},
fac4ff
+  {"malign-branch-boundary", required_argument, NULL, OPTION_MALIGN_BRANCH_BOUNDARY},
fac4ff
+  {"malign-branch-prefix-size", required_argument, NULL, OPTION_MALIGN_BRANCH_PREFIX_SIZE},
fac4ff
+  {"malign-branch", required_argument, NULL, OPTION_MALIGN_BRANCH},
fac4ff
+  {"mbranches-within-32B-boundaries", no_argument, NULL, OPTION_MBRANCHES_WITH_32B_BOUNDARIES},
fac4ff
   {"mamd64", no_argument, NULL, OPTION_MAMD64},
fac4ff
   {"mintel64", no_argument, NULL, OPTION_MINTEL64},
fac4ff
   {NULL, no_argument, NULL, 0}
fac4ff
@@ -10007,7 +10877,7 @@ int
fac4ff
 md_parse_option (int c, const char *arg)
fac4ff
 {
fac4ff
   unsigned int j;
fac4ff
-  char *arch, *next, *saved;
fac4ff
+  char *arch, *next, *saved, *type;
fac4ff
 
fac4ff
   switch (c)
fac4ff
     {
fac4ff
@@ -10110,6 +10980,82 @@ md_parse_option (int c, const char *arg)
fac4ff
 #endif
fac4ff
       break;
fac4ff
 
fac4ff
+    case OPTION_MALIGN_BRANCH_BOUNDARY:
fac4ff
+      {
fac4ff
+	char *end;
fac4ff
+	int align = strtoul (arg, &end, 0);
fac4ff
+
fac4ff
+	if (*end == '\0')
fac4ff
+	  {
fac4ff
+	    if (align == 0)
fac4ff
+	      {
fac4ff
+		align_branch_power = 0;
fac4ff
+		break;
fac4ff
+	      }
fac4ff
+	    else if (align >= 32)
fac4ff
+	      {
fac4ff
+		int align_power;
fac4ff
+
fac4ff
+		for (align_power = 0;
fac4ff
+		     (align & 1) == 0;
fac4ff
+		     align >>= 1, align_power++)
fac4ff
+		  continue;
fac4ff
+
fac4ff
+		if (align == 1)
fac4ff
+		  {
fac4ff
+		    align_branch_power = align_power;
fac4ff
+		    break;
fac4ff
+		  }
fac4ff
+	      }
fac4ff
+	  }
fac4ff
+	as_fatal (_("invalid -malign-branch-boundary= value: %s"), arg);
fac4ff
+      }
fac4ff
+      break;
fac4ff
+
fac4ff
+    case OPTION_MALIGN_BRANCH_PREFIX_SIZE:
fac4ff
+      {
fac4ff
+	char *end;
fac4ff
+	int align = strtoul (arg, &end, 0);
fac4ff
+
fac4ff
+	if (*end == '\0' && align >= 0 && align < 6)
fac4ff
+	  {
fac4ff
+	    align_branch_prefix_size = align;
fac4ff
+	    break;
fac4ff
+	  }
fac4ff
+	as_fatal (_("invalid -malign-branch-prefix-size= value: %s"),
fac4ff
+		  arg);
fac4ff
+      }
fac4ff
+      break;
fac4ff
+
fac4ff
+    case OPTION_MALIGN_BRANCH:
fac4ff
+      align_branch = 0;
fac4ff
+      saved = xstrdup (arg);
fac4ff
+      type = saved;
fac4ff
+      do
fac4ff
+	{
fac4ff
+	  next = strchr (type, '+');
fac4ff
+	  if (next)
fac4ff
+	    *next++ = '\0';
fac4ff
+	  if (strcasecmp (type, "jcc") == 0)
fac4ff
+	    align_branch |= align_branch_jcc;
fac4ff
+	  else if (strcasecmp (type, "fused") == 0)
fac4ff
+	    align_branch |= align_branch_fused;
fac4ff
+	  else if (strcasecmp (type, "jmp") == 0)
fac4ff
+	    align_branch |= align_branch_jmp;
fac4ff
+	  else if (strcasecmp (type, "call") == 0)
fac4ff
+	    align_branch |= align_branch_call;
fac4ff
+	  else if (strcasecmp (type, "ret") == 0)
fac4ff
+	    align_branch |= align_branch_ret;
fac4ff
+	  else if (strcasecmp (type, "indirect") == 0)
fac4ff
+	    align_branch |= align_branch_indirect;
fac4ff
+	  else
fac4ff
+	    as_fatal (_("invalid -malign-branch= option: `%s'"), arg);
fac4ff
+	  type = next;
fac4ff
+	}
fac4ff
+      while (next != NULL);
fac4ff
+      free (saved);
fac4ff
+      break;
fac4ff
+
fac4ff
     case OPTION_MARCH:
fac4ff
       saved = xstrdup (arg);
fac4ff
       arch = saved;
fac4ff
@@ -10363,6 +11309,14 @@ md_parse_option (int c, const char *arg)
fac4ff
         as_fatal (_("invalid -mrelax-relocations= option: `%s'"), arg);
fac4ff
       break;
fac4ff
 
fac4ff
+    case OPTION_MBRANCHES_WITH_32B_BOUNDARIES:
fac4ff
+      align_branch_power = 5;
fac4ff
+      align_branch_prefix_size = 5;
fac4ff
+      align_branch = (align_branch_jcc
fac4ff
+		      | align_branch_fused
fac4ff
+		      | align_branch_jmp);
fac4ff
+      break;
fac4ff
+
fac4ff
     case OPTION_MAMD64:
fac4ff
       intel64 = 0;
fac4ff
       break;
fac4ff
@@ -10567,6 +11521,20 @@ md_show_usage (FILE *stream)
fac4ff
   -mrelax-relocations=[no|yes]\n\
fac4ff
                           generate relax relocations\n"));
fac4ff
   fprintf (stream, _("\
fac4ff
+  -malign-branch-boundary=NUM (default: 0)\n\
fac4ff
+                          align branches within NUM byte boundary\n"));
fac4ff
+  fprintf (stream, _("\
fac4ff
+  -malign-branch=TYPE[+TYPE...] (default: jcc+fused+jmp)\n\
fac4ff
+                          TYPE is combination of jcc, fused, jmp, call, ret,\n\
fac4ff
+                           indirect\n\
fac4ff
+                          specify types of branches to align\n"));
fac4ff
+  fprintf (stream, _("\
fac4ff
+  -malign-branch-prefix-size=NUM (default: 5)\n\
fac4ff
+                          align branches with NUM prefixes per instruction\n"));
fac4ff
+  fprintf (stream, _("\
fac4ff
+  -mbranches-within-32B-boundaries\n\
fac4ff
+                          align branches within 32 byte boundary\n"));
fac4ff
+  fprintf (stream, _("\
fac4ff
   -mamd64                 accept only AMD64 ISA\n"));
fac4ff
   fprintf (stream, _("\
fac4ff
   -mintel64               accept only Intel64 ISA\n"));
fac4ff
@@ -10650,17 +11618,26 @@ i386_target_format (void)
fac4ff
 	  {
fac4ff
 	  default:
fac4ff
 	    format = ELF_TARGET_FORMAT;
fac4ff
+#ifndef TE_SOLARIS
fac4ff
+	    tls_get_addr = "___tls_get_addr";
fac4ff
+#endif
fac4ff
 	    break;
fac4ff
 	  case X86_64_ABI:
fac4ff
 	    use_rela_relocations = 1;
fac4ff
 	    object_64bit = 1;
fac4ff
 	    format = ELF_TARGET_FORMAT64;
fac4ff
+#ifndef TE_SOLARIS
fac4ff
+	    tls_get_addr = "__tls_get_addr";
fac4ff
+#endif
fac4ff
 	    break;
fac4ff
 	  case X86_64_X32_ABI:
fac4ff
 	    use_rela_relocations = 1;
fac4ff
 	    object_64bit = 1;
fac4ff
 	    disallow_64bit_reloc = 1;
fac4ff
 	    format = ELF_TARGET_FORMAT32;
fac4ff
+#ifndef TE_SOLARIS
fac4ff
+	    tls_get_addr = "__tls_get_addr";
fac4ff
+#endif
fac4ff
 	    break;
fac4ff
 	  }
fac4ff
 	if (cpu_arch_isa == PROCESSOR_L1OM)
fac4ff
@@ -10775,6 +11752,21 @@ s_bss (int ignore ATTRIBUTE_UNUSED)
fac4ff
 
fac4ff
 #endif
fac4ff
 
fac4ff
+/* Remember constant diretive.  */
fac4ff
+
fac4ff
+void
fac4ff
+i386_cons_worker (int ignore ATTRIBUTE_UNUSED)
fac4ff
+{
fac4ff
+  if (last_insn.kind != last_insn_directive
fac4ff
+      && (bfd_get_section_flags (NULL, now_seg) & SEC_CODE))
fac4ff
+    {
fac4ff
+      last_insn.seg = now_seg;
fac4ff
+      last_insn.kind = last_insn_directive;
fac4ff
+      last_insn.name = "constant diretive";
fac4ff
+      last_insn.file = as_where (&last_insn.line);
fac4ff
+    }
fac4ff
+}
fac4ff
+
fac4ff
 void
fac4ff
 i386_validate_fix (fixS *fixp)
fac4ff
 {
fac4ff
diff -rupN binutils.orig/gas/config/tc-i386.h binutils-2.30/gas/config/tc-i386.h
fac4ff
--- binutils.orig/gas/config/tc-i386.h	2019-11-20 10:59:21.585883785 +0000
fac4ff
+++ binutils-2.30/gas/config/tc-i386.h	2019-11-20 15:24:24.677440688 +0000
fac4ff
@@ -215,12 +215,19 @@ if (fragP->fr_type == rs_align_code)
fac4ff
 			   - fragP->fr_address				\
fac4ff
 			   - fragP->fr_fix));
fac4ff
 
fac4ff
+extern void i386_cons_worker (int);
fac4ff
+#define md_cons_align(nbytes) i386_cons_worker (nbytes)
fac4ff
+
fac4ff
 void i386_print_statistics (FILE *);
fac4ff
 #define tc_print_statistics i386_print_statistics
fac4ff
 
fac4ff
 extern unsigned int i386_frag_max_var (fragS *);
fac4ff
 #define md_frag_max_var i386_frag_max_var
fac4ff
 
fac4ff
+extern long i386_generic_table_relax_frag (segT, fragS *, long);
fac4ff
+#define md_generic_table_relax_frag(segment, fragP, stretch) \
fac4ff
+  i386_generic_table_relax_frag (segment, fragP, stretch)
fac4ff
+
fac4ff
 #define md_number_to_chars number_to_chars_littleendian
fac4ff
 
fac4ff
 enum processor_type
fac4ff
@@ -255,9 +262,24 @@ extern i386_cpu_flags cpu_arch_isa_flags
fac4ff
 
fac4ff
 struct i386_tc_frag_data
fac4ff
 {
fac4ff
+  union
fac4ff
+    {
fac4ff
+      fragS *padding_fragP;
fac4ff
+      fragS *branch_fragP;
fac4ff
+    } u;
fac4ff
+  addressT padding_address;
fac4ff
   enum processor_type isa;
fac4ff
   i386_cpu_flags isa_flags;
fac4ff
+  unsigned int max_bytes;
fac4ff
   enum processor_type tune;
fac4ff
+  signed char length;
fac4ff
+  signed char last_length;
fac4ff
+  signed char max_prefix_length;
fac4ff
+  signed char prefix_length;
fac4ff
+  signed char default_prefix;
fac4ff
+  signed char cmp_size;
fac4ff
+  unsigned int classified : 1;
fac4ff
+  unsigned int branch_type : 7;
fac4ff
 };
fac4ff
 
fac4ff
 /* We need to emit the right NOP pattern in .align frags.  This is
fac4ff
@@ -268,9 +290,20 @@ struct i386_tc_frag_data
fac4ff
 #define TC_FRAG_INIT(FRAGP)					\
fac4ff
  do								\
fac4ff
    {								\
fac4ff
+     (FRAGP)->tc_frag_data.u.padding_fragP = NULL;		\
fac4ff
+     (FRAGP)->tc_frag_data.padding_address = 0;			\
fac4ff
      (FRAGP)->tc_frag_data.isa = cpu_arch_isa;			\
fac4ff
      (FRAGP)->tc_frag_data.isa_flags = cpu_arch_isa_flags;	\
fac4ff
      (FRAGP)->tc_frag_data.tune = cpu_arch_tune;		\
fac4ff
+     (FRAGP)->tc_frag_data.length = 0;				\
fac4ff
+     (FRAGP)->tc_frag_data.max_bytes = max_chars;		\
fac4ff
+     (FRAGP)->tc_frag_data.last_length = 0;			\
fac4ff
+     (FRAGP)->tc_frag_data.max_prefix_length = 0;		\
fac4ff
+     (FRAGP)->tc_frag_data.prefix_length = 0;			\
fac4ff
+     (FRAGP)->tc_frag_data.default_prefix = 0;			\
fac4ff
+     (FRAGP)->tc_frag_data.cmp_size = 0;			\
fac4ff
+     (FRAGP)->tc_frag_data.classified = 0;			\
fac4ff
+     (FRAGP)->tc_frag_data.branch_type = 0;			\
fac4ff
    }								\
fac4ff
  while (0)
fac4ff
 
fac4ff
diff -rupN binutils.orig/gas/doc/c-i386.texi binutils-2.30/gas/doc/c-i386.texi
fac4ff
--- binutils.orig/gas/doc/c-i386.texi	2019-11-20 10:59:21.590883746 +0000
fac4ff
+++ binutils-2.30/gas/doc/c-i386.texi	2019-11-20 15:08:24.874736461 +0000
fac4ff
@@ -389,6 +389,43 @@ R_X86_64_REX_GOTPCRELX, in 64-bit mode.
fac4ff
 relocations.  The default can be controlled by a configure option
fac4ff
 @option{--enable-x86-relax-relocations}.
fac4ff
 
fac4ff
+@cindex @samp{-malign-branch-boundary=} option, i386
fac4ff
+@cindex @samp{-malign-branch-boundary=} option, x86-64
fac4ff
+@item -malign-branch-boundary=@var{NUM}
fac4ff
+This option controls how the assembler should align branches with segment
fac4ff
+prefixes or NOP.  @var{NUM} must be a power of 2.  It should be 0 or
fac4ff
+no less than 32.  Branches will be aligned within @var{NUM} byte
fac4ff
+boundary.  @option{-malign-branch-boundary=0}, which is the default,
fac4ff
+doesn't align branches.
fac4ff
+
fac4ff
+@cindex @samp{-malign-branch=} option, i386
fac4ff
+@cindex @samp{-malign-branch=} option, x86-64
fac4ff
+@item -malign-branch=@var{TYPE}[+@var{TYPE}...]
fac4ff
+This option specifies types of branches to align. @var{TYPE} is
fac4ff
+combination of @samp{jcc}, which aligns conditional jumps,
fac4ff
+@samp{fused}, which aligns fused conditional jumps, @samp{jmp},
fac4ff
+which aligns unconditional jumps, @samp{call} which aligns calls,
fac4ff
+@samp{ret}, which aligns rets, @samp{indirect}, which aligns indirect
fac4ff
+jumps and calls.  The default is @option{-malign-branch=jcc+fused+jmp}.
fac4ff
+
fac4ff
+@cindex @samp{-malign-branch-prefix-size=} option, i386
fac4ff
+@cindex @samp{-malign-branch-prefix-size=} option, x86-64
fac4ff
+@item -malign-branch-prefix-size=@var{NUM}
fac4ff
+This option specifies the maximum number of prefixes on an instruction
fac4ff
+to align branches.  @var{NUM} should be between 0 and 5.  The default
fac4ff
+@var{NUM} is 5.
fac4ff
+
fac4ff
+@cindex @samp{-mbranches-within-32B-boundaries} option, i386
fac4ff
+@cindex @samp{-mbranches-within-32B-boundaries} option, x86-64
fac4ff
+@item -mbranches-within-32B-boundaries
fac4ff
+This option aligns conditional jumps, fused conditional jumps and
fac4ff
+unconditional jumps within 32 byte boundary with up to 5 segment prefixes
fac4ff
+on an instruction.  It is equivalent to
fac4ff
+@option{-malign-branch-boundary=32}
fac4ff
+@option{-malign-branch=jcc+fused+jmp}
fac4ff
+@option{-malign-branch-prefix-size=5}.
fac4ff
+The default doesn't align branches.
fac4ff
+
fac4ff
 @cindex @samp{-mevexrcig=} option, i386
fac4ff
 @cindex @samp{-mevexrcig=} option, x86-64
fac4ff
 @item -mevexrcig=@var{rne}
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1a.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1a.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1a.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1a.d	2019-11-20 14:09:25.593915106 +0000
fac4ff
@@ -0,0 +1,77 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 65 65 a3 01 00 00 00 	gs gs mov %eax,%gs:0x1
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	39 c5                	cmp    %eax,%ebp
fac4ff
+  22:	74 5e                	je     82 <foo\+0x82>
fac4ff
+  24:	3e 89 73 f4          	mov    %esi,%ds:-0xc\(%ebx\)
fac4ff
+  28:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2b:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	5d                   	pop    %ebp
fac4ff
+  3e:	5d                   	pop    %ebp
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %ebp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	36 89 44 24 fc       	mov    %eax,%ss:-0x4\(%esp\)
fac4ff
+  4a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4d:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  50:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  53:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  56:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  59:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5f:	5d                   	pop    %ebp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  78:	5d                   	pop    %ebp
fac4ff
+  79:	5d                   	pop    %ebp
fac4ff
+  7a:	39 c5                	cmp    %eax,%ebp
fac4ff
+  7c:	74 04                	je     82 <foo\+0x82>
fac4ff
+  7e:	66 90                	xchg   %ax,%ax
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%ebp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  a0:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  a3:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ae:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b4:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ba:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  c0:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  c3:	74 c3                	je     88 <foo\+0x88>
fac4ff
+  c5:	74 c1                	je     88 <foo\+0x88>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1b.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1b.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1b.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1b.d	2019-11-20 14:09:25.593915106 +0000
fac4ff
@@ -0,0 +1,77 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 65 65 a3 01 00 00 00 	gs gs mov %eax,%gs:0x1
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	39 c5                	cmp    %eax,%ebp
fac4ff
+  22:	74 5e                	je     82 <foo\+0x82>
fac4ff
+  24:	3e 89 73 f4          	mov    %esi,%ds:-0xc\(%ebx\)
fac4ff
+  28:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2b:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	5d                   	pop    %ebp
fac4ff
+  3e:	5d                   	pop    %ebp
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %ebp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	36 89 44 24 fc       	mov    %eax,%ss:-0x4\(%esp\)
fac4ff
+  4a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4d:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  50:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  53:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  56:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  59:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5f:	5d                   	pop    %ebp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  78:	5d                   	pop    %ebp
fac4ff
+  79:	5d                   	pop    %ebp
fac4ff
+  7a:	39 c5                	cmp    %eax,%ebp
fac4ff
+  7c:	74 04                	je     82 <foo\+0x82>
fac4ff
+  7e:	66 90                	xchg   %ax,%ax
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%ebp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  a0:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  a3:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ae:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b4:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ba:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  c0:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  c3:	74 c3                	je     88 <foo\+0x88>
fac4ff
+  c5:	74 c1                	je     88 <foo\+0x88>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1c.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1c.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1c.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1c.d	2019-11-20 14:09:25.594915098 +0000
fac4ff
@@ -0,0 +1,77 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch-prefix-size=1
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 a3 01 00 00 00    	mov    %eax,%gs:0x1
fac4ff
+   6:	3e 55                	ds push %ebp
fac4ff
+   8:	3e 55                	ds push %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	39 c5                	cmp    %eax,%ebp
fac4ff
+  22:	74 5e                	je     82 <foo\+0x82>
fac4ff
+  24:	3e 89 73 f4          	mov    %esi,%ds:-0xc\(%ebx\)
fac4ff
+  28:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2b:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	5d                   	pop    %ebp
fac4ff
+  3e:	5d                   	pop    %ebp
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %ebp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	36 89 44 24 fc       	mov    %eax,%ss:-0x4\(%esp\)
fac4ff
+  4a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4d:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  50:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  53:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  56:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  59:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5f:	5d                   	pop    %ebp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  78:	5d                   	pop    %ebp
fac4ff
+  79:	5d                   	pop    %ebp
fac4ff
+  7a:	39 c5                	cmp    %eax,%ebp
fac4ff
+  7c:	74 04                	je     82 <foo\+0x82>
fac4ff
+  7e:	66 90                	xchg   %ax,%ax
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%ebp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  a0:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  a3:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ae:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b4:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ba:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  c0:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  c3:	74 c3                	je     88 <foo\+0x88>
fac4ff
+  c5:	74 c1                	je     88 <foo\+0x88>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1d.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1d.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1d.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1d.d	2019-11-20 14:09:25.594915098 +0000
fac4ff
@@ -0,0 +1,76 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 65 65 a3 01 00 00 00 	gs gs mov %eax,%gs:0x1
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	39 c5                	cmp    %eax,%ebp
fac4ff
+  22:	74 5b                	je     7f <foo\+0x7f>
fac4ff
+  24:	3e 89 73 f4          	mov    %esi,%ds:-0xc\(%ebx\)
fac4ff
+  28:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2b:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	5d                   	pop    %ebp
fac4ff
+  3e:	5d                   	pop    %ebp
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 3d                	je     7f <foo\+0x7f>
fac4ff
+  42:	5d                   	pop    %ebp
fac4ff
+  43:	74 3a                	je     7f <foo\+0x7f>
fac4ff
+  45:	89 44 24 fc          	mov    %eax,-0x4\(%esp\)
fac4ff
+  49:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5e:	5d                   	pop    %ebp
fac4ff
+  5f:	eb 24                	jmp    85 <foo\+0x85>
fac4ff
+  61:	eb 22                	jmp    85 <foo\+0x85>
fac4ff
+  63:	eb 20                	jmp    85 <foo\+0x85>
fac4ff
+  65:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  68:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6b:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  71:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  74:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  77:	5d                   	pop    %ebp
fac4ff
+  78:	5d                   	pop    %ebp
fac4ff
+  79:	39 c5                	cmp    %eax,%ebp
fac4ff
+  7b:	74 02                	je     7f <foo\+0x7f>
fac4ff
+  7d:	eb 06                	jmp    85 <foo\+0x85>
fac4ff
+  7f:	8b 45 f4             	mov    -0xc\(%ebp\),%eax
fac4ff
+  82:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  85:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8b:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  91:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  97:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9d:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  a0:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a5:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ab:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b1:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b7:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  bd:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  c0:	74 c3                	je     85 <foo\+0x85>
fac4ff
+  c2:	74 c1                	je     85 <foo\+0x85>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1e.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1e.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1e.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1e.d	2019-11-20 14:09:25.594915098 +0000
fac4ff
@@ -0,0 +1,77 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=jcc
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 a3 01 00 00 00    	mov    %eax,%gs:0x1
fac4ff
+   6:	55                   	push   %ebp
fac4ff
+   7:	55                   	push   %ebp
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	89 e5                	mov    %esp,%ebp
fac4ff
+   c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+   f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  12:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  15:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  18:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1e:	39 c5                	cmp    %eax,%ebp
fac4ff
+  20:	74 5a                	je     7c <foo\+0x7c>
fac4ff
+  22:	89 73 f4             	mov    %esi,-0xc\(%ebx\)
fac4ff
+  25:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  28:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	5d                   	pop    %ebp
fac4ff
+  3b:	5d                   	pop    %ebp
fac4ff
+  3c:	5d                   	pop    %ebp
fac4ff
+  3d:	74 3d                	je     7c <foo\+0x7c>
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 3a                	je     7c <foo\+0x7c>
fac4ff
+  42:	89 44 24 fc          	mov    %eax,-0x4\(%esp\)
fac4ff
+  46:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  49:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  4c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5b:	5d                   	pop    %ebp
fac4ff
+  5c:	eb 24                	jmp    82 <foo\+0x82>
fac4ff
+  5e:	eb 22                	jmp    82 <foo\+0x82>
fac4ff
+  60:	eb 20                	jmp    82 <foo\+0x82>
fac4ff
+  62:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  65:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  68:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  71:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  74:	5d                   	pop    %ebp
fac4ff
+  75:	5d                   	pop    %ebp
fac4ff
+  76:	39 c5                	cmp    %eax,%ebp
fac4ff
+  78:	74 02                	je     7c <foo\+0x7c>
fac4ff
+  7a:	eb 06                	jmp    82 <foo\+0x82>
fac4ff
+  7c:	8b 45 f4             	mov    -0xc\(%ebp\),%eax
fac4ff
+  7f:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  82:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9a:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  9d:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a2:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  a8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ae:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b4:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ba:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  bd:	74 c3                	je     82 <foo\+0x82>
fac4ff
+  bf:	90                   	nop
fac4ff
+  c0:	74 c0                	je     82 <foo\+0x82>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1f.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1f.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1f.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1f.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,77 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 a3 01 00 00 00    	mov    %eax,%gs:0x1
fac4ff
+   6:	55                   	push   %ebp
fac4ff
+   7:	55                   	push   %ebp
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	89 e5                	mov    %esp,%ebp
fac4ff
+   c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+   f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  12:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  15:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  18:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1e:	39 c5                	cmp    %eax,%ebp
fac4ff
+  20:	74 5c                	je     7e <foo\+0x7e>
fac4ff
+  22:	89 73 f4             	mov    %esi,-0xc\(%ebx\)
fac4ff
+  25:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  28:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	5d                   	pop    %ebp
fac4ff
+  3b:	5d                   	pop    %ebp
fac4ff
+  3c:	5d                   	pop    %ebp
fac4ff
+  3d:	74 3f                	je     7e <foo\+0x7e>
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 3c                	je     7e <foo\+0x7e>
fac4ff
+  42:	89 44 24 fc          	mov    %eax,-0x4\(%esp\)
fac4ff
+  46:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  49:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  4c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5b:	5d                   	pop    %ebp
fac4ff
+  5c:	eb 27                	jmp    85 <foo\+0x85>
fac4ff
+  5e:	66 90                	xchg   %ax,%ax
fac4ff
+  60:	eb 23                	jmp    85 <foo\+0x85>
fac4ff
+  62:	eb 21                	jmp    85 <foo\+0x85>
fac4ff
+  64:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  67:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6a:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  70:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  73:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  76:	5d                   	pop    %ebp
fac4ff
+  77:	5d                   	pop    %ebp
fac4ff
+  78:	39 c5                	cmp    %eax,%ebp
fac4ff
+  7a:	74 02                	je     7e <foo\+0x7e>
fac4ff
+  7c:	eb 07                	jmp    85 <foo\+0x85>
fac4ff
+  7e:	36 8b 45 f4          	mov    %ss:-0xc\(%ebp\),%eax
fac4ff
+  82:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  85:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8b:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  91:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  97:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9d:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  a0:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a5:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ab:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b1:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b7:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  bd:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  c0:	74 c3                	je     85 <foo\+0x85>
fac4ff
+  c2:	74 c1                	je     85 <foo\+0x85>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1g.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1g.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1g.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1g.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,77 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -mbranches-within-32B-boundaries
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 65 65 a3 01 00 00 00 	gs gs mov %eax,%gs:0x1
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	39 c5                	cmp    %eax,%ebp
fac4ff
+  22:	74 5e                	je     82 <foo\+0x82>
fac4ff
+  24:	3e 89 73 f4          	mov    %esi,%ds:-0xc\(%ebx\)
fac4ff
+  28:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2b:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	5d                   	pop    %ebp
fac4ff
+  3e:	5d                   	pop    %ebp
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %ebp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	36 89 44 24 fc       	mov    %eax,%ss:-0x4\(%esp\)
fac4ff
+  4a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4d:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  50:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  53:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  56:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  59:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5f:	5d                   	pop    %ebp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  78:	5d                   	pop    %ebp
fac4ff
+  79:	5d                   	pop    %ebp
fac4ff
+  7a:	39 c5                	cmp    %eax,%ebp
fac4ff
+  7c:	74 04                	je     82 <foo\+0x82>
fac4ff
+  7e:	66 90                	xchg   %ax,%ax
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%ebp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  a0:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  a3:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ae:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b4:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ba:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  c0:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  c3:	74 c3                	je     88 <foo\+0x88>
fac4ff
+  c5:	74 c1                	je     88 <foo\+0x88>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1h.d binutils-2.30/gas/testsuite/gas/i386/align-branch-1h.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1h.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1h.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,76 @@
fac4ff
+#source: align-branch-1.s
fac4ff
+#as: -mbranches-within-32B-boundaries -malign-branch-boundary=0
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	65 a3 01 00 00 00    	mov    %eax,%gs:0x1
fac4ff
+   6:	55                   	push   %ebp
fac4ff
+   7:	55                   	push   %ebp
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	89 e5                	mov    %esp,%ebp
fac4ff
+   c:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+   f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  12:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  15:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  18:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1e:	39 c5                	cmp    %eax,%ebp
fac4ff
+  20:	74 5a                	je     7c <foo\+0x7c>
fac4ff
+  22:	89 73 f4             	mov    %esi,-0xc\(%ebx\)
fac4ff
+  25:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  28:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  2b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	5d                   	pop    %ebp
fac4ff
+  3b:	5d                   	pop    %ebp
fac4ff
+  3c:	5d                   	pop    %ebp
fac4ff
+  3d:	74 3d                	je     7c <foo\+0x7c>
fac4ff
+  3f:	5d                   	pop    %ebp
fac4ff
+  40:	74 3a                	je     7c <foo\+0x7c>
fac4ff
+  42:	89 44 24 fc          	mov    %eax,-0x4\(%esp\)
fac4ff
+  46:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  49:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  4c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5b:	5d                   	pop    %ebp
fac4ff
+  5c:	eb 24                	jmp    82 <foo\+0x82>
fac4ff
+  5e:	eb 22                	jmp    82 <foo\+0x82>
fac4ff
+  60:	eb 20                	jmp    82 <foo\+0x82>
fac4ff
+  62:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  65:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  68:	89 7d f8             	mov    %edi,-0x8\(%ebp\)
fac4ff
+  6b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  71:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  74:	5d                   	pop    %ebp
fac4ff
+  75:	5d                   	pop    %ebp
fac4ff
+  76:	39 c5                	cmp    %eax,%ebp
fac4ff
+  78:	74 02                	je     7c <foo\+0x7c>
fac4ff
+  7a:	eb 06                	jmp    82 <foo\+0x82>
fac4ff
+  7c:	8b 45 f4             	mov    -0xc\(%ebp\),%eax
fac4ff
+  7f:	89 45 fc             	mov    %eax,-0x4\(%ebp\)
fac4ff
+  82:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  9a:	89 75 0c             	mov    %esi,0xc\(%ebp\)
fac4ff
+  9d:	e9 [0-9a-f ]+       	jmp    .*
fac4ff
+  a2:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  a8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ae:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  b4:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%ebp\)
fac4ff
+  ba:	89 75 00             	mov    %esi,0x0\(%ebp\)
fac4ff
+  bd:	74 c3                	je     82 <foo\+0x82>
fac4ff
+  bf:	74 c1                	je     82 <foo\+0x82>
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-1.s binutils-2.30/gas/testsuite/gas/i386/align-branch-1.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-1.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-1.s	2019-11-20 14:09:25.592915114 +0000
fac4ff
@@ -0,0 +1,72 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl	%eax, %gs:0x1
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %edi, -8(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  cmp  %eax, %ebp
fac4ff
+  je  .L_2
fac4ff
+  movl  %esi, -12(%ebx)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %edi, -8(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  popl  %ebp
fac4ff
+  popl  %ebp
fac4ff
+  popl  %ebp
fac4ff
+  je  .L_2
fac4ff
+  popl  %ebp
fac4ff
+  je  .L_2
fac4ff
+  movl  %eax, -4(%esp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %edi, -8(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  popl  %ebp
fac4ff
+  jmp  .L_3
fac4ff
+  jmp  .L_3
fac4ff
+  jmp  .L_3
fac4ff
+  movl  %eax, -4(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %edi, -8(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  popl  %ebp
fac4ff
+  popl  %ebp
fac4ff
+  cmp  %eax, %ebp
fac4ff
+  je  .L_2
fac4ff
+  jmp  .L_3
fac4ff
+.L_2:
fac4ff
+  movl  -12(%ebp), %eax
fac4ff
+  movl  %eax, -4(%ebp)
fac4ff
+.L_3:
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, 12(%ebp)
fac4ff
+  jmp  bar
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, -1200(%ebp)
fac4ff
+  movl  %esi, (%ebp)
fac4ff
+  je .L_3
fac4ff
+  je .L_3
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2a.d binutils-2.30/gas/testsuite/gas/i386/align-branch-2a.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-2a.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2a.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,55 @@
fac4ff
+#source: align-branch-2.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+   6:	55                   	push   %ebp
fac4ff
+   7:	55                   	push   %ebp
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	89 e5                	mov    %esp,%ebp
fac4ff
+   c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+   f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  12:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  15:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  18:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1e:	ff e0                	jmp    \*%eax
fac4ff
+  20:	55                   	push   %ebp
fac4ff
+  21:	55                   	push   %ebp
fac4ff
+  22:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  28:	89 e5                	mov    %esp,%ebp
fac4ff
+  2a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  30:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  33:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  36:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  39:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3c:	ff d0                	call   \*%eax
fac4ff
+  3e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  41:	55                   	push   %ebp
fac4ff
+  42:	55                   	push   %ebp
fac4ff
+  43:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  49:	89 e5                	mov    %esp,%ebp
fac4ff
+  4b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  4e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  51:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  54:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  57:	e8 [0-9a-f ]+       	call   .*
fac4ff
+  5c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5f:	55                   	push   %ebp
fac4ff
+  60:	55                   	push   %ebp
fac4ff
+  61:	55                   	push   %ebp
fac4ff
+  62:	55                   	push   %ebp
fac4ff
+  63:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  69:	89 e5                	mov    %esp,%ebp
fac4ff
+  6b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  6e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  71:	ff 15 00 00 00 00    	call   \*0x0
fac4ff
+  77:	55                   	push   %ebp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2b.d binutils-2.30/gas/testsuite/gas/i386/align-branch-2b.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-2b.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2b.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,55 @@
fac4ff
+#source: align-branch-2.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=indirect
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 a3 01 00 00 00 	fs fs mov %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	ff e0                	jmp    \*%eax
fac4ff
+  22:	3e 3e 55             	ds ds push %ebp
fac4ff
+  25:	55                   	push   %ebp
fac4ff
+  26:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  2c:	89 e5                	mov    %esp,%ebp
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  40:	ff d0                	call   \*%eax
fac4ff
+  42:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  45:	55                   	push   %ebp
fac4ff
+  46:	55                   	push   %ebp
fac4ff
+  47:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  4d:	89 e5                	mov    %esp,%ebp
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5b:	e8 [0-9a-f ]+       	call   .*
fac4ff
+  60:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  63:	55                   	push   %ebp
fac4ff
+  64:	55                   	push   %ebp
fac4ff
+  65:	55                   	push   %ebp
fac4ff
+  66:	55                   	push   %ebp
fac4ff
+  67:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  6d:	89 e5                	mov    %esp,%ebp
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  75:	ff 15 00 00 00 00    	call   \*0x0
fac4ff
+  7b:	55                   	push   %ebp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2c.d binutils-2.30/gas/testsuite/gas/i386/align-branch-2c.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-2c.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2c.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,55 @@
fac4ff
+#source: align-branch-2.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=indirect+call
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 a3 01 00 00 00 	fs fs mov %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	ff e0                	jmp    \*%eax
fac4ff
+  22:	3e 3e 55             	ds ds push %ebp
fac4ff
+  25:	55                   	push   %ebp
fac4ff
+  26:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  2c:	89 e5                	mov    %esp,%ebp
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  40:	ff d0                	call   \*%eax
fac4ff
+  42:	36 36 36 36 36 89 75 f4 	ss ss ss ss mov %esi,%ss:-0xc\(%ebp\)
fac4ff
+  4a:	55                   	push   %ebp
fac4ff
+  4b:	55                   	push   %ebp
fac4ff
+  4c:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  52:	89 e5                	mov    %esp,%ebp
fac4ff
+  54:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  57:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  5d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  60:	e8 [0-9a-f ]+       	call   .*
fac4ff
+  65:	36 36 36 36 36 89 75 f4 	ss ss ss ss mov %esi,%ss:-0xc\(%ebp\)
fac4ff
+  6d:	3e 55                	ds push %ebp
fac4ff
+  6f:	55                   	push   %ebp
fac4ff
+  70:	55                   	push   %ebp
fac4ff
+  71:	55                   	push   %ebp
fac4ff
+  72:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  78:	89 e5                	mov    %esp,%ebp
fac4ff
+  7a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  7d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  80:	ff 15 00 00 00 00    	call   \*0x0
fac4ff
+  86:	55                   	push   %ebp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-2.s binutils-2.30/gas/testsuite/gas/i386/align-branch-2.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-2.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-2.s	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,49 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  jmp  *%eax
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  call *%eax
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  call  foo
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  call  *foo
fac4ff
+  pushl  %ebp
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-3.d binutils-2.30/gas/testsuite/gas/i386/align-branch-3.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-3.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-3.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,33 @@
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=indirect+call
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+   6:	55                   	push   %ebp
fac4ff
+   7:	55                   	push   %ebp
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	89 e5                	mov    %esp,%ebp
fac4ff
+   c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+   f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  12:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  15:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  18:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1b:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1e:	e8 fc ff ff ff       	call   1f <foo\+0x1f>
fac4ff
+  23:	55                   	push   %ebp
fac4ff
+  24:	55                   	push   %ebp
fac4ff
+  25:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  2b:	89 e5                	mov    %esp,%ebp
fac4ff
+  2d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  30:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  33:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  36:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  39:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3c:	ff 91 00 00 00 00    	call   \*0x0\(%ecx\)
fac4ff
+  42:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-3.s binutils-2.30/gas/testsuite/gas/i386/align-branch-3.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-3.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-3.s	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,28 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  call	___tls_get_addr
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  call *___tls_get_addr@GOT(%ecx)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-4a.d binutils-2.30/gas/testsuite/gas/i386/align-branch-4a.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-4a.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-4a.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,36 @@
fac4ff
+#source: align-branch-4.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+   6:	55                   	push   %ebp
fac4ff
+   7:	55                   	push   %ebp
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	89 e5                	mov    %esp,%ebp
fac4ff
+   d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  10:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  13:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  16:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  19:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1c:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1f:	c3                   	ret    
fac4ff
+  20:	55                   	push   %ebp
fac4ff
+  21:	55                   	push   %ebp
fac4ff
+  22:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  28:	89 e5                	mov    %esp,%ebp
fac4ff
+  2a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  2d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  30:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  33:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  36:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  39:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3c:	c2 1e 00             	ret    \$0x1e
fac4ff
+  3f:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-4b.d binutils-2.30/gas/testsuite/gas/i386/align-branch-4b.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-4b.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-4b.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,36 @@
fac4ff
+#source: align-branch-4.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=ret
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 a3 01 00 00 00 	fs mov %eax,%fs:0x1
fac4ff
+   7:	55                   	push   %ebp
fac4ff
+   8:	55                   	push   %ebp
fac4ff
+   9:	55                   	push   %ebp
fac4ff
+   a:	55                   	push   %ebp
fac4ff
+   b:	55                   	push   %ebp
fac4ff
+   c:	89 e5                	mov    %esp,%ebp
fac4ff
+   e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  20:	c3                   	ret    
fac4ff
+  21:	3e 3e 3e 55          	ds ds ds push %ebp
fac4ff
+  25:	55                   	push   %ebp
fac4ff
+  26:	64 a3 01 00 00 00    	mov    %eax,%fs:0x1
fac4ff
+  2c:	89 e5                	mov    %esp,%ebp
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  3d:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+  40:	c2 1e 00             	ret    \$0x1e
fac4ff
+  43:	89 75 f4             	mov    %esi,-0xc\(%ebp\)
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-4.s binutils-2.30/gas/testsuite/gas/i386/align-branch-4.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-4.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-4.s	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,30 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  ret
fac4ff
+  pushl  %ebp
fac4ff
+  pushl  %ebp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movl  %esp, %ebp
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
+  ret	$30
fac4ff
+  movl  %esi, -12(%ebp)
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-5.d binutils-2.30/gas/testsuite/gas/i386/align-branch-5.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-5.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-5.d	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,36 @@
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=jcc+fused+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+   3:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+   6:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+   9:	89 d1                	mov    %edx,%ecx
fac4ff
+   b:	31 c0                	xor    %eax,%eax
fac4ff
+   d:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  10:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  13:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  16:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  19:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  1c:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  1f:	f6 c2 02             	test   \$0x2,%dl
fac4ff
+  22:	f3 ab                	rep stos %eax,%es:\(%edi\)
fac4ff
+  24:	75 dd                	jne    3 <foo\+0x3>
fac4ff
+  26:	31 c0                	xor    %eax,%eax
fac4ff
+  28:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  2b:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  2e:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  31:	89 d1                	mov    %edx,%ecx
fac4ff
+  33:	31 c0                	xor    %eax,%eax
fac4ff
+  35:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  38:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  3b:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  3e:	f6 c2 02             	test   \$0x2,%dl
fac4ff
+  41:	e8 [0-9a-f ]+       	call   .*
fac4ff
+  46:	75 e3                	jne    2b <foo\+0x2b>
fac4ff
+  48:	31 c0                	xor    %eax,%eax
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/align-branch-5.s binutils-2.30/gas/testsuite/gas/i386/align-branch-5.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/align-branch-5.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/align-branch-5.s	2019-11-20 14:09:25.595915091 +0000
fac4ff
@@ -0,0 +1,32 @@
fac4ff
+	.text
fac4ff
+	.p2align 4,,15
fac4ff
+foo:
fac4ff
+	shrl	$2, %ecx
fac4ff
+.L1:
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	movl	%edx, %ecx
fac4ff
+	xorl	%eax, %eax
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	testb	$2, %dl
fac4ff
+	rep stosl
fac4ff
+	jne	.L1
fac4ff
+	xorl	%eax, %eax
fac4ff
+	shrl	$2, %ecx
fac4ff
+.L2:
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	movl	%edx, %ecx
fac4ff
+	xorl	%eax, %eax
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	shrl	$2, %ecx
fac4ff
+	testb	$2, %dl
fac4ff
+	call	bar
fac4ff
+	jne	.L2
fac4ff
+	xorl	%eax, %eax
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/i386.exp binutils-2.30/gas/testsuite/gas/i386/i386.exp
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/i386.exp	2019-11-20 10:59:21.657883233 +0000
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/i386.exp	2019-11-20 14:09:39.865805050 +0000
fac4ff
@@ -425,6 +425,20 @@ if [expr ([istarget "i*86-*-*"] ||  [ist
fac4ff
     run_dump_test "align-1a"
fac4ff
     run_dump_test "align-1b"
fac4ff
     run_list_test "inval-pseudo" "-al"
fac4ff
+    run_dump_test "align-branch-1a"
fac4ff
+    run_dump_test "align-branch-1b"
fac4ff
+    run_dump_test "align-branch-1c"
fac4ff
+    run_dump_test "align-branch-1d"
fac4ff
+    run_dump_test "align-branch-1e"
fac4ff
+    run_dump_test "align-branch-1f"
fac4ff
+    run_dump_test "align-branch-1g"
fac4ff
+    run_dump_test "align-branch-1h"
fac4ff
+    run_dump_test "align-branch-2a"
fac4ff
+    run_dump_test "align-branch-2b"
fac4ff
+    run_dump_test "align-branch-2c"
fac4ff
+    run_dump_test "align-branch-4a"
fac4ff
+    run_dump_test "align-branch-4b"
fac4ff
+    run_dump_test "align-branch-5"
fac4ff
 
fac4ff
     # These tests require support for 8 and 16 bit relocs,
fac4ff
     # so we only run them for ELF and COFF targets.
fac4ff
@@ -489,6 +503,10 @@ if [expr ([istarget "i*86-*-*"] ||  [ist
fac4ff
 
fac4ff
 	run_dump_test "addend"
fac4ff
 
fac4ff
+	if {[istarget "*-*-linux*"]} then {
fac4ff
+	    run_dump_test "align-branch-3"
fac4ff
+	}
fac4ff
+
fac4ff
 	if { [gas_64_check] } then {
fac4ff
 	    run_dump_test "att-regs"
fac4ff
 	    run_dump_test "intel-regs"
fac4ff
@@ -892,6 +910,20 @@ if [expr ([istarget "i*86-*-*"] || [ista
fac4ff
     run_list_test "x86-64-notrackbad" "-al"
fac4ff
     run_dump_test "x86-64-movd"
fac4ff
     run_dump_test "x86-64-movd-intel"
fac4ff
+    run_dump_test "x86-64-align-branch-1a"
fac4ff
+    run_dump_test "x86-64-align-branch-1b"
fac4ff
+    run_dump_test "x86-64-align-branch-1c"
fac4ff
+    run_dump_test "x86-64-align-branch-1d"
fac4ff
+    run_dump_test "x86-64-align-branch-1e"
fac4ff
+    run_dump_test "x86-64-align-branch-1f"
fac4ff
+    run_dump_test "x86-64-align-branch-1g"
fac4ff
+    run_dump_test "x86-64-align-branch-1h"
fac4ff
+    run_dump_test "x86-64-align-branch-2a"
fac4ff
+    run_dump_test "x86-64-align-branch-2b"
fac4ff
+    run_dump_test "x86-64-align-branch-2c"
fac4ff
+    run_dump_test "x86-64-align-branch-4a"
fac4ff
+    run_dump_test "x86-64-align-branch-4b"
fac4ff
+    run_dump_test "x86-64-align-branch-5"
fac4ff
 
fac4ff
     if { ![istarget "*-*-aix*"]
fac4ff
       && ![istarget "*-*-beos*"]
fac4ff
@@ -949,6 +981,10 @@ if [expr ([istarget "i*86-*-*"] || [ista
fac4ff
 	run_dump_test "x86-64-gotpcrel-no-relax"
fac4ff
 
fac4ff
 	run_dump_test "x86-64-addend"
fac4ff
+
fac4ff
+	if {[istarget "*-*-linux*"]} then {
fac4ff
+	    run_dump_test "x86-64-align-branch-3"
fac4ff
+	}
fac4ff
     }
fac4ff
 
fac4ff
     set ASFLAGS "$old_ASFLAGS"
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1a.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1a.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1a.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1a.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,75 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 64 89 04 25 01 00 00 00 	fs fs fs mov %eax,%fs:0x1
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	55                   	push   %rbp
fac4ff
+   d:	55                   	push   %rbp
fac4ff
+   e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  23:	74 5d                	je     82 <foo\+0x82>
fac4ff
+  25:	2e 89 75 f4          	mov    %esi,%cs:-0xc\(%rbp\)
fac4ff
+  29:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  32:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  35:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  38:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3e:	5d                   	pop    %rbp
fac4ff
+  3f:	5d                   	pop    %rbp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %rbp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	2e 89 45 fc          	mov    %eax,%cs:-0x4\(%rbp\)
fac4ff
+  49:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5e:	5d                   	pop    %rbp
fac4ff
+  5f:	5d                   	pop    %rbp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  78:	5d                   	pop    %rbp
fac4ff
+  79:	5d                   	pop    %rbp
fac4ff
+  7a:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  7d:	74 03                	je     82 <foo\+0x82>
fac4ff
+  7f:	90                   	nop
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a0:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a6:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  ac:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b2:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  be:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  c4:	eb c2                	jmp    88 <foo\+0x88>
fac4ff
+  c6:	5d                   	pop    %rbp
fac4ff
+  c7:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1b.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1b.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1b.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1b.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,75 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 64 89 04 25 01 00 00 00 	fs fs fs mov %eax,%fs:0x1
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	55                   	push   %rbp
fac4ff
+   d:	55                   	push   %rbp
fac4ff
+   e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  23:	74 5d                	je     82 <foo\+0x82>
fac4ff
+  25:	2e 89 75 f4          	mov    %esi,%cs:-0xc\(%rbp\)
fac4ff
+  29:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  32:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  35:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  38:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3e:	5d                   	pop    %rbp
fac4ff
+  3f:	5d                   	pop    %rbp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %rbp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	2e 89 45 fc          	mov    %eax,%cs:-0x4\(%rbp\)
fac4ff
+  49:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5e:	5d                   	pop    %rbp
fac4ff
+  5f:	5d                   	pop    %rbp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  78:	5d                   	pop    %rbp
fac4ff
+  79:	5d                   	pop    %rbp
fac4ff
+  7a:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  7d:	74 03                	je     82 <foo\+0x82>
fac4ff
+  7f:	90                   	nop
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a0:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a6:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  ac:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b2:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  be:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  c4:	eb c2                	jmp    88 <foo\+0x88>
fac4ff
+  c6:	5d                   	pop    %rbp
fac4ff
+  c7:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1c.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1c.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1c.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1c.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,75 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch-prefix-size=1
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+   8:	2e 55                	cs push %rbp
fac4ff
+   a:	2e 55                	cs push %rbp
fac4ff
+   c:	2e 55                	cs push %rbp
fac4ff
+   e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  23:	74 5d                	je     82 <foo\+0x82>
fac4ff
+  25:	2e 89 75 f4          	mov    %esi,%cs:-0xc\(%rbp\)
fac4ff
+  29:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  32:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  35:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  38:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3e:	5d                   	pop    %rbp
fac4ff
+  3f:	5d                   	pop    %rbp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %rbp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	2e 89 45 fc          	mov    %eax,%cs:-0x4\(%rbp\)
fac4ff
+  49:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5e:	5d                   	pop    %rbp
fac4ff
+  5f:	5d                   	pop    %rbp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  78:	5d                   	pop    %rbp
fac4ff
+  79:	5d                   	pop    %rbp
fac4ff
+  7a:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  7d:	74 03                	je     82 <foo\+0x82>
fac4ff
+  7f:	90                   	nop
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a0:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a6:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  ac:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b2:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  be:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  c4:	eb c2                	jmp    88 <foo\+0x88>
fac4ff
+  c6:	5d                   	pop    %rbp
fac4ff
+  c7:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1d.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1d.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1d.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1d.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,74 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 64 89 04 25 01 00 00 00 	fs fs fs mov %eax,%fs:0x1
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	55                   	push   %rbp
fac4ff
+   d:	55                   	push   %rbp
fac4ff
+   e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  23:	74 5b                	je     80 <foo\+0x80>
fac4ff
+  25:	2e 89 75 f4          	mov    %esi,%cs:-0xc\(%rbp\)
fac4ff
+  29:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  32:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  35:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  38:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3e:	5d                   	pop    %rbp
fac4ff
+  3f:	5d                   	pop    %rbp
fac4ff
+  40:	74 3e                	je     80 <foo\+0x80>
fac4ff
+  42:	5d                   	pop    %rbp
fac4ff
+  43:	74 3b                	je     80 <foo\+0x80>
fac4ff
+  45:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  48:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4b:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  51:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  54:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  57:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5d:	5d                   	pop    %rbp
fac4ff
+  5e:	5d                   	pop    %rbp
fac4ff
+  5f:	eb 25                	jmp    86 <foo\+0x86>
fac4ff
+  61:	eb 23                	jmp    86 <foo\+0x86>
fac4ff
+  63:	eb 21                	jmp    86 <foo\+0x86>
fac4ff
+  65:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  68:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6b:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  71:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  74:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  77:	5d                   	pop    %rbp
fac4ff
+  78:	5d                   	pop    %rbp
fac4ff
+  79:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  7c:	74 02                	je     80 <foo\+0x80>
fac4ff
+  7e:	eb 06                	jmp    86 <foo\+0x86>
fac4ff
+  80:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  83:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  86:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8c:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  92:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  98:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a4:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  aa:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b0:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b6:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  bc:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  c2:	eb c2                	jmp    86 <foo\+0x86>
fac4ff
+  c4:	5d                   	pop    %rbp
fac4ff
+  c5:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1e.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1e.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1e.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1e.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,74 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=jcc
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %rbp
fac4ff
+   9:	55                   	push   %rbp
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+   e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  20:	74 5b                	je     7d <foo\+0x7d>
fac4ff
+  22:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  25:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  28:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3a:	5d                   	pop    %rbp
fac4ff
+  3b:	5d                   	pop    %rbp
fac4ff
+  3c:	74 3f                	je     7d <foo\+0x7d>
fac4ff
+  3e:	2e 5d                	cs pop %rbp
fac4ff
+  40:	74 3b                	je     7d <foo\+0x7d>
fac4ff
+  42:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  45:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  48:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  51:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  54:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  57:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5a:	5d                   	pop    %rbp
fac4ff
+  5b:	5d                   	pop    %rbp
fac4ff
+  5c:	eb 25                	jmp    83 <foo\+0x83>
fac4ff
+  5e:	eb 23                	jmp    83 <foo\+0x83>
fac4ff
+  60:	eb 21                	jmp    83 <foo\+0x83>
fac4ff
+  62:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  65:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  68:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  71:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  74:	5d                   	pop    %rbp
fac4ff
+  75:	5d                   	pop    %rbp
fac4ff
+  76:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  79:	74 02                	je     7d <foo\+0x7d>
fac4ff
+  7b:	eb 06                	jmp    83 <foo\+0x83>
fac4ff
+  7d:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  80:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  83:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  89:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8f:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  95:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9b:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a1:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a7:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  ad:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b3:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b9:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  bf:	eb c2                	jmp    83 <foo\+0x83>
fac4ff
+  c1:	5d                   	pop    %rbp
fac4ff
+  c2:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1f.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1f.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1f.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1f.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,75 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %rbp
fac4ff
+   9:	55                   	push   %rbp
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+   e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  20:	74 5d                	je     7f <foo\+0x7f>
fac4ff
+  22:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  25:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  28:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3a:	5d                   	pop    %rbp
fac4ff
+  3b:	5d                   	pop    %rbp
fac4ff
+  3c:	74 41                	je     7f <foo\+0x7f>
fac4ff
+  3e:	2e 5d                	cs pop %rbp
fac4ff
+  40:	74 3d                	je     7f <foo\+0x7f>
fac4ff
+  42:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  45:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  48:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  51:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  54:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  57:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5a:	5d                   	pop    %rbp
fac4ff
+  5b:	5d                   	pop    %rbp
fac4ff
+  5c:	eb 27                	jmp    85 <foo\+0x85>
fac4ff
+  5e:	66 90                	xchg   %ax,%ax
fac4ff
+  60:	eb 23                	jmp    85 <foo\+0x85>
fac4ff
+  62:	eb 21                	jmp    85 <foo\+0x85>
fac4ff
+  64:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  67:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6a:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  70:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  73:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  76:	5d                   	pop    %rbp
fac4ff
+  77:	5d                   	pop    %rbp
fac4ff
+  78:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  7b:	74 02                	je     7f <foo\+0x7f>
fac4ff
+  7d:	eb 06                	jmp    85 <foo\+0x85>
fac4ff
+  7f:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  82:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  85:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8b:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  91:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  97:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9d:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a3:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a9:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  af:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b5:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  bb:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  c1:	eb c2                	jmp    85 <foo\+0x85>
fac4ff
+  c3:	5d                   	pop    %rbp
fac4ff
+  c4:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1g.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1g.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1g.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1g.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,75 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -mbranches-within-32B-boundaries
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 64 89 04 25 01 00 00 00 	fs fs fs mov %eax,%fs:0x1
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	55                   	push   %rbp
fac4ff
+   d:	55                   	push   %rbp
fac4ff
+   e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  23:	74 5d                	je     82 <foo\+0x82>
fac4ff
+  25:	2e 89 75 f4          	mov    %esi,%cs:-0xc\(%rbp\)
fac4ff
+  29:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  32:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  35:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  38:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3e:	5d                   	pop    %rbp
fac4ff
+  3f:	5d                   	pop    %rbp
fac4ff
+  40:	74 40                	je     82 <foo\+0x82>
fac4ff
+  42:	5d                   	pop    %rbp
fac4ff
+  43:	74 3d                	je     82 <foo\+0x82>
fac4ff
+  45:	2e 89 45 fc          	mov    %eax,%cs:-0x4\(%rbp\)
fac4ff
+  49:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5e:	5d                   	pop    %rbp
fac4ff
+  5f:	5d                   	pop    %rbp
fac4ff
+  60:	eb 26                	jmp    88 <foo\+0x88>
fac4ff
+  62:	eb 24                	jmp    88 <foo\+0x88>
fac4ff
+  64:	eb 22                	jmp    88 <foo\+0x88>
fac4ff
+  66:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  69:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6c:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  72:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  75:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  78:	5d                   	pop    %rbp
fac4ff
+  79:	5d                   	pop    %rbp
fac4ff
+  7a:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  7d:	74 03                	je     82 <foo\+0x82>
fac4ff
+  7f:	90                   	nop
fac4ff
+  80:	eb 06                	jmp    88 <foo\+0x88>
fac4ff
+  82:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  85:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a0:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a6:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  ac:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b2:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  be:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  c4:	eb c2                	jmp    88 <foo\+0x88>
fac4ff
+  c6:	5d                   	pop    %rbp
fac4ff
+  c7:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1h.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1h.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1h.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1h.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,74 @@
fac4ff
+#source: x86-64-align-branch-1.s
fac4ff
+#as: -mbranches-within-32B-boundaries -malign-branch-boundary=0
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %rbp
fac4ff
+   9:	55                   	push   %rbp
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+   e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  20:	74 5a                	je     7c <foo\+0x7c>
fac4ff
+  22:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  25:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  28:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  2b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3a:	5d                   	pop    %rbp
fac4ff
+  3b:	5d                   	pop    %rbp
fac4ff
+  3c:	74 3e                	je     7c <foo\+0x7c>
fac4ff
+  3e:	5d                   	pop    %rbp
fac4ff
+  3f:	74 3b                	je     7c <foo\+0x7c>
fac4ff
+  41:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  44:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  47:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  4a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  4d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  50:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  53:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  56:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  59:	5d                   	pop    %rbp
fac4ff
+  5a:	5d                   	pop    %rbp
fac4ff
+  5b:	eb 25                	jmp    82 <foo\+0x82>
fac4ff
+  5d:	eb 23                	jmp    82 <foo\+0x82>
fac4ff
+  5f:	eb 21                	jmp    82 <foo\+0x82>
fac4ff
+  61:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  64:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  67:	89 7d f8             	mov    %edi,-0x8\(%rbp\)
fac4ff
+  6a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  6d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  70:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  73:	5d                   	pop    %rbp
fac4ff
+  74:	5d                   	pop    %rbp
fac4ff
+  75:	48 39 c5             	cmp    %rax,%rbp
fac4ff
+  78:	74 02                	je     7c <foo\+0x7c>
fac4ff
+  7a:	eb 06                	jmp    82 <foo\+0x82>
fac4ff
+  7c:	8b 45 f4             	mov    -0xc\(%rbp\),%eax
fac4ff
+  7f:	89 45 fc             	mov    %eax,-0x4\(%rbp\)
fac4ff
+  82:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  88:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  8e:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  94:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  9a:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a0:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  a6:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  ac:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b2:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  b8:	89 b5 50 fb ff ff    	mov    %esi,-0x4b0\(%rbp\)
fac4ff
+  be:	eb c2                	jmp    82 <foo\+0x82>
fac4ff
+  c0:	5d                   	pop    %rbp
fac4ff
+  c1:	c3                   	retq   
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-1.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-1.s	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,70 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  cmp  %rax, %rbp
fac4ff
+  je  .L_2
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %edi, -8(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  popq  %rbp
fac4ff
+  popq  %rbp
fac4ff
+  je  .L_2
fac4ff
+  popq  %rbp
fac4ff
+  je  .L_2
fac4ff
+  movl  %eax, -4(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %edi, -8(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  popq  %rbp
fac4ff
+  popq  %rbp
fac4ff
+  jmp  .L_3
fac4ff
+  jmp  .L_3
fac4ff
+  jmp  .L_3
fac4ff
+  movl  %eax, -4(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %edi, -8(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  popq  %rbp
fac4ff
+  popq  %rbp
fac4ff
+  cmp  %rax, %rbp
fac4ff
+  je  .L_2
fac4ff
+  jmp  .L_3
fac4ff
+.L_2:
fac4ff
+  movl  -12(%rbp), %eax
fac4ff
+  movl  %eax, -4(%rbp)
fac4ff
+.L_3:
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  movl  %esi, -1200(%rbp)
fac4ff
+  jmp  .L_3
fac4ff
+  popq  %rbp
fac4ff
+  retq
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2a.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2a.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2a.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2a.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,50 @@
fac4ff
+#source: x86-64-align-branch-2.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %rbp
fac4ff
+   9:	55                   	push   %rbp
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+   f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  12:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  15:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  18:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1e:	ff e0                	jmpq   \*%rax
fac4ff
+  20:	55                   	push   %rbp
fac4ff
+  21:	55                   	push   %rbp
fac4ff
+  22:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  2a:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  2d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  30:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  33:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  36:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  39:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3c:	ff d0                	callq  \*%rax
fac4ff
+  3e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  41:	55                   	push   %rbp
fac4ff
+  42:	55                   	push   %rbp
fac4ff
+  43:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  4b:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  4e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  51:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  54:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  57:	e8 [0-9a-f ]+       	callq  .*
fac4ff
+  5c:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5f:	55                   	push   %rbp
fac4ff
+  60:	55                   	push   %rbp
fac4ff
+  61:	55                   	push   %rbp
fac4ff
+  62:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  6a:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  6d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  70:	ff 14 25 00 00 00 00 	callq  \*0x0
fac4ff
+  77:	55                   	push   %rbp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2b.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2b.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2b.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2b.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,50 @@
fac4ff
+#source: x86-64-align-branch-2.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=indirect
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 89 04 25 01 00 00 00 	fs fs mov %eax,%fs:0x1
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	55                   	push   %rbp
fac4ff
+   d:	55                   	push   %rbp
fac4ff
+   e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	ff e0                	jmpq   \*%rax
fac4ff
+  22:	2e 2e 55             	cs cs push %rbp
fac4ff
+  25:	55                   	push   %rbp
fac4ff
+  26:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  2e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  40:	ff d0                	callq  \*%rax
fac4ff
+  42:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  45:	55                   	push   %rbp
fac4ff
+  46:	55                   	push   %rbp
fac4ff
+  47:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  4f:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  52:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  55:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  58:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5b:	e8 [0-9a-f ]+       	callq  .*
fac4ff
+  60:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  63:	55                   	push   %rbp
fac4ff
+  64:	55                   	push   %rbp
fac4ff
+  65:	55                   	push   %rbp
fac4ff
+  66:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  6e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  71:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  74:	ff 14 25 00 00 00 00 	callq  \*0x0
fac4ff
+  7b:	55                   	push   %rbp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2c.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2c.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2c.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2c.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,50 @@
fac4ff
+#source: x86-64-align-branch-2.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=indirect+call
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 64 89 04 25 01 00 00 00 	fs fs mov %eax,%fs:0x1
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	55                   	push   %rbp
fac4ff
+   d:	55                   	push   %rbp
fac4ff
+   e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	ff e0                	jmpq   \*%rax
fac4ff
+  22:	2e 2e 55             	cs cs push %rbp
fac4ff
+  25:	55                   	push   %rbp
fac4ff
+  26:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  2e:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  40:	ff d0                	callq  \*%rax
fac4ff
+  42:	2e 2e 2e 2e 2e 89 75 f4 	cs cs cs cs mov %esi,%cs:-0xc\(%rbp\)
fac4ff
+  4a:	55                   	push   %rbp
fac4ff
+  4b:	55                   	push   %rbp
fac4ff
+  4c:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  54:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  57:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  5d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  60:	e8 [0-9a-f ]+       	callq  .*
fac4ff
+  65:	2e 2e 2e 2e 2e 89 75 f4 	cs cs cs cs mov %esi,%cs:-0xc\(%rbp\)
fac4ff
+  6d:	2e 2e 55             	cs cs push %rbp
fac4ff
+  70:	55                   	push   %rbp
fac4ff
+  71:	55                   	push   %rbp
fac4ff
+  72:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  7a:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  7d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  80:	ff 14 25 00 00 00 00 	callq  \*0x0
fac4ff
+  87:	55                   	push   %rbp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-2.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-2.s	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,44 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  jmp  *%rax
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  call *%rax
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  call  foo
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  call  *foo
fac4ff
+  pushq  %rbp
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.d	2019-11-20 14:09:25.596915083 +0000
fac4ff
@@ -0,0 +1,32 @@
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=indirect+call
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %rbp
fac4ff
+   9:	55                   	push   %rbp
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	55                   	push   %rbp
fac4ff
+   c:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+   f:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  12:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  15:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  18:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1e:	e8 00 00 00 00       	callq  23 <foo\+0x23>
fac4ff
+  23:	55                   	push   %rbp
fac4ff
+  24:	55                   	push   %rbp
fac4ff
+  25:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  2d:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+  30:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  33:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  36:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  39:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3c:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3f:	ff 15 00 00 00 00    	callq  \*0x0\(%rip\)        # 45 <foo\+0x45>
fac4ff
+  45:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-3.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-3.s	2019-11-20 14:09:25.597915075 +0000
fac4ff
@@ -0,0 +1,27 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  call	__tls_get_addr
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  call	*__tls_get_addr@GOTPCREL(%rip)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4a.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4a.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4a.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4a.d	2019-11-20 14:09:25.597915075 +0000
fac4ff
@@ -0,0 +1,33 @@
fac4ff
+#source: x86-64-align-branch-4.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=fused+jcc+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+   8:	55                   	push   %rbp
fac4ff
+   9:	55                   	push   %rbp
fac4ff
+   a:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+   d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  10:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  13:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  16:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  19:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1c:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1f:	c3                   	retq   
fac4ff
+  20:	55                   	push   %rbp
fac4ff
+  21:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  29:	55                   	push   %rbp
fac4ff
+  2a:	55                   	push   %rbp
fac4ff
+  2b:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3d:	c2 1e 00             	retq   \$0x1e
fac4ff
+  40:	55                   	push   %rbp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4b.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4b.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4b.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4b.d	2019-11-20 14:09:25.597915075 +0000
fac4ff
@@ -0,0 +1,33 @@
fac4ff
+#source: x86-64-align-branch-4.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=ret
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	64 64 89 04 25 01 00 00 00 	fs mov %eax,%fs:0x1
fac4ff
+   9:	55                   	push   %rbp
fac4ff
+   a:	55                   	push   %rbp
fac4ff
+   b:	48 89 e5             	mov    %rsp,%rbp
fac4ff
+   e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  11:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  14:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  17:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  1d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  20:	c3                   	retq   
fac4ff
+  21:	2e 2e 55             	cs cs push %rbp
fac4ff
+  24:	64 89 04 25 01 00 00 00 	mov    %eax,%fs:0x1
fac4ff
+  2c:	55                   	push   %rbp
fac4ff
+  2d:	55                   	push   %rbp
fac4ff
+  2e:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  31:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  34:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  37:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3a:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  3d:	89 75 f4             	mov    %esi,-0xc\(%rbp\)
fac4ff
+  40:	c2 1e 00             	retq   \$0x1e
fac4ff
+  43:	55                   	push   %rbp
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4.s binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4.s
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-4.s	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-4.s	2019-11-20 14:09:25.597915075 +0000
fac4ff
@@ -0,0 +1,27 @@
fac4ff
+  .text
fac4ff
+  .globl  foo
fac4ff
+  .p2align  4
fac4ff
+foo:
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movq  %rsp, %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  ret
fac4ff
+  pushq  %rbp
fac4ff
+  movl  %eax, %fs:0x1
fac4ff
+  pushq  %rbp
fac4ff
+  pushq  %rbp
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  movl  %esi, -12(%rbp)
fac4ff
+  ret $30
fac4ff
+  pushq  %rbp
fac4ff
diff -rupN binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-5.d binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-5.d
fac4ff
--- binutils.orig/gas/testsuite/gas/i386/x86-64-align-branch-5.d	1970-01-01 01:00:00.000000000 +0100
fac4ff
+++ binutils-2.30/gas/testsuite/gas/i386/x86-64-align-branch-5.d	2019-11-20 14:09:25.597915075 +0000
fac4ff
@@ -0,0 +1,37 @@
fac4ff
+#source: align-branch-5.s
fac4ff
+#as: -malign-branch-boundary=32 -malign-branch=jcc+fused+jmp
fac4ff
+#objdump: -dw
fac4ff
+
fac4ff
+.*: +file format .*
fac4ff
+
fac4ff
+Disassembly of section .text:
fac4ff
+
fac4ff
+0+ <foo>:
fac4ff
+   0:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+   3:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+   6:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+   9:	89 d1                	mov    %edx,%ecx
fac4ff
+   b:	31 c0                	xor    %eax,%eax
fac4ff
+   d:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  10:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  13:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  16:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  19:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  1c:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  1f:	f6 c2 02             	test   \$0x2,%dl
fac4ff
+  22:	f3 ab                	rep stos %eax,%es:\(%rdi\)
fac4ff
+  24:	75 dd                	jne    3 <foo\+0x3>
fac4ff
+  26:	31 c0                	xor    %eax,%eax
fac4ff
+  28:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  2b:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  2e:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  31:	89 d1                	mov    %edx,%ecx
fac4ff
+  33:	31 c0                	xor    %eax,%eax
fac4ff
+  35:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  38:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  3b:	c1 e9 02             	shr    \$0x2,%ecx
fac4ff
+  3e:	f6 c2 02             	test   \$0x2,%dl
fac4ff
+  41:	e8 00 00 00 00       	callq  46 <foo\+0x46>
fac4ff
+  46:	75 e3                	jne    2b <foo\+0x2b>
fac4ff
+  48:	31 c0                	xor    %eax,%eax
fac4ff
+#pass
fac4ff
diff -rupN binutils.orig/gas/write.c binutils-2.30/gas/write.c
fac4ff
--- binutils.orig/gas/write.c	2019-11-20 10:59:21.592883731 +0000
fac4ff
+++ binutils-2.30/gas/write.c	2019-11-20 14:30:33.613133740 +0000
fac4ff
@@ -2987,7 +2987,12 @@ relax_segment (struct frag *segment_frag
fac4ff
 #ifdef TC_GENERIC_RELAX_TABLE
fac4ff
 		/* The default way to relax a frag is to look through
fac4ff
 		   TC_GENERIC_RELAX_TABLE.  */
fac4ff
+#ifdef md_generic_table_relax_frag
fac4ff
+		growth = md_generic_table_relax_frag (segment, fragP,
fac4ff
+						      stretch);
fac4ff
+#else
fac4ff
 		growth = relax_frag (segment, fragP, stretch);
fac4ff
+#endif /* md_generic_table_relax_frag */
fac4ff
 #endif /* TC_GENERIC_RELAX_TABLE  */
fac4ff
 #endif
fac4ff
 		break;