diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 5154b1981eb5f9745d301567563f15437b03773a..e4bc0e8cafc5a1db45076edf8e872b07b642ec99 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,7 @@
+2016-12-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+	* iresolve.c (gfc_resolve_ftell): Call "ftell" instead of "ftell2".
+
 2016-12-20  Janne Blomqvist  <jb@gcc.gnu.org>
 
 	* trans-types.c (gfc_init_types): Don't redefine boolean type node.
diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c
index b289c9f684058973c435541e7dfe2531018e9dfd..a30ed9f3d6560caa72f079338f4a6689c65a6b77 100644
--- a/gcc/fortran/iresolve.c
+++ b/gcc/fortran/iresolve.c
@@ -2604,7 +2604,7 @@ gfc_resolve_ftell (gfc_expr *f, gfc_expr *u)
       gfc_convert_type (u, &ts, 2);
     }
 
-  f->value.function.name = gfc_get_string (PREFIX ("ftell2"));
+  f->value.function.name = gfc_get_string (PREFIX ("ftell"));
 }
 
 
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 26707049e52b72ae6d8e19f870b39d16287d6125..2c24253b6403e4533b90300fbde2cdecd9acd8b4 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2016-12-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+	* gfortran.map: Remove _gfortran_ftell2.
+	* io/intrinsics.c (ftell): Remove.
+	(ftell2): Rename to ftell.
+
 2016-12-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
 	* gfortran.map: Move all _gfortran_* __iso_c_binding_* symbols
diff --git a/libgfortran/gfortran.map b/libgfortran/gfortran.map
index cddb88a251b7ef79cc39ccdbacfea7c9c53c7695..460bfe4965dbfd1248ea0ddfb381d9956cabbeda 100644
--- a/libgfortran/gfortran.map
+++ b/libgfortran/gfortran.map
@@ -257,7 +257,6 @@ GFORTRAN_7 {
     _gfortran_fstat_i4_sub;
     _gfortran_fstat_i8;
     _gfortran_fstat_i8_sub;
-    _gfortran_ftell2;
     _gfortran_ftell;
     _gfortran_ftell_i1_sub;
     _gfortran_ftell_i2_sub;
diff --git a/libgfortran/io/intrinsics.c b/libgfortran/io/intrinsics.c
index 5bf08f3391a0bee9e664a0e85c8b71fa2df537c7..ad8e28bc4b5cf3ef8e695d17178dba476504954e 100644
--- a/libgfortran/io/intrinsics.c
+++ b/libgfortran/io/intrinsics.c
@@ -272,29 +272,11 @@ gf_ftell (int unit)
 }
 
 
-/* Here is the ftell function with an incorrect return type; retained
-   due to ABI compatibility.  */
-
-extern size_t PREFIX(ftell) (int *);
+extern GFC_IO_INT PREFIX(ftell) (int *);
 export_proto_np(PREFIX(ftell));
 
-size_t
-PREFIX(ftell) (int * unit)
-{
-  return gf_ftell (*unit);
-}
-
-
-/* Here is the ftell function with the correct return type, ensuring
-   that large files can be supported as long as the target supports
-   large integers; as of 4.8 the FTELL intrinsic function will call
-   this one instead of the old ftell above.  */
-
-extern GFC_IO_INT PREFIX(ftell2) (int *);
-export_proto_np(PREFIX(ftell2));
-
 GFC_IO_INT
-PREFIX(ftell2) (int * unit)
+PREFIX(ftell) (int * unit)
 {
   return gf_ftell (*unit);
 }