diff mbox

[AArch64] -mcmodel=tiny -fPIC use tiny absolute for non binds local.

Message ID 51A8C460.2090906@arm.com
State New
Headers show

Commit Message

Marcus Shawcroft May 31, 2013, 3:40 p.m. UTC
This change allows -mcmodel=tiny -fPIC to use tiny addressing instead of 
small for none GOT accesses.

Regressed for aarch64-none-elf with -mcmodel=tiny and -mcmodel=tiny -fPIC

Applied.

/Marcus

2013-05-31  Marcus Shawcroft  <marcus.shawcroft@arm.com>

         * config/aarch64/aarch64.c (aarch64_classify_symbol):
         Use SYMBOL_TINY_ABSOLUTE for AARCH64_CMODEL_TINY_PIC.
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index a9e754c..7d975fd 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -5073,6 +5073,10 @@  aarch64_classify_symbol (rtx x,
 	  return SYMBOL_SMALL_ABSOLUTE;
 
 	case AARCH64_CMODEL_TINY_PIC:
+	  if (!aarch64_symbol_binds_local_p (x))
+	    return SYMBOL_SMALL_GOT;
+	  return SYMBOL_TINY_ABSOLUTE;
+
 	case AARCH64_CMODEL_SMALL_PIC:
 	  if (!aarch64_symbol_binds_local_p (x))
 	    return SYMBOL_SMALL_GOT;