diff --git a/gcc/ChangeLog.aarch64 b/gcc/ChangeLog.aarch64
index 3c8ff13..f4e1e91 100644
--- a/gcc/ChangeLog.aarch64
+++ b/gcc/ChangeLog.aarch64
@@ -1,3 +1,12 @@
+2013-08-11  Andrew Pinski  <apinski@cavium.com>
+
+ Bug #7079
+ * config/aarch64/aarch64.md (*movsi_aarch64): Use Ust instead of S constrain.
+ (*movdi_aarch64): Likewise.
+ (ldr_got_small_sidi): Add type attribute.
+ * config/aarch64/constraints.md (Ust): New constraint like S but only
+ if the symbol is SYMBOL_TINY_ABSOLUTE.
+
 2013-08-14  Yufeng Zhang  <yufeng.zhang@arm.com>

  * function.c (assign_parm_find_data_types): Set passed_mode and
diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index 485bd59..0cd6a41 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -810,7 +810,7 @@

 (define_insn "*movsi_aarch64"
   [(set (match_operand:SI 0 "nonimmediate_operand" "=r,k,r,r,r,*w,m,
m,r,r  ,*w, r,*w")
- (match_operand:SI 1 "aarch64_mov_operand"  " r,r,k,M,m,
m,rZ,*w,S,Ush,rZ,*w,*w"))]
+ (match_operand:SI 1 "aarch64_mov_operand"  " r,r,k,M,m,
m,rZ,*w,Ust,Ush,rZ,*w,*w"))]
   "(register_operand (operands[0], SImode)
     || aarch64_reg_or_zero (operands[1], SImode))"
   "@
@@ -836,7 +836,7 @@

 (define_insn "*movdi_aarch64"
   [(set (match_operand:DI 0 "nonimmediate_operand" "=r,k,r,r,r,*w,m,
m,r,r,  *w, r,*w,w")
- (match_operand:DI 1 "aarch64_mov_operand"  " r,r,k,N,m,
m,rZ,*w,S,Ush,rZ,*w,*w,Dd"))]
+ (match_operand:DI 1 "aarch64_mov_operand"  " r,r,k,N,m,
m,rZ,*w,Ust,Ush,rZ,*w,*w,Dd"))]
   "(register_operand (operands[0], DImode)
     || aarch64_reg_or_zero (operands[1], DImode))"
   "@
@@ -3978,6 +3978,7 @@
   "TARGET_ILP32"
   "ldr\\t%w0, [%1, #:got_lo12:%a2]"
   [(set_attr "v8type" "load1")
+   (set_attr "type" "load1")
    (set_attr "mode" "DI")]
 )

diff --git a/gcc/config/aarch64/constraints.md
b/gcc/config/aarch64/constraints.md
index 2570400..a36bdaf 100644
--- a/gcc/config/aarch64/constraints.md
+++ b/gcc/config/aarch64/constraints.md
@@ -114,6 +114,12 @@
   (and (match_code "const_int")
        (match_test "(unsigned) exact_log2 (ival) <= 4")))

+(define_constraint "Ust"
+  "A constraint that matches an absolute symbolic address; only for
tiny model."
+  (and (match_code "const,symbol_ref,label_ref")
+       (match_test "aarch64_symbolic_address_p (op)
+    && aarch64_classify_symbolic_expression (op, SYMBOL_CONTEXT_ADR)
== SYMBOL_TINY_ABSOLUTE")))
+
 (define_memory_constraint "Q"
