This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/59888] New: ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE ...
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 20 Jan 2014 13:48:12 +0000
- Subject: [Bug target/59888] New: ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE ...
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59888
Bug ID: 59888
Summary: ld: warning: PIE disabled. Absolute addressing
(perhaps -mdynamic-no-pic) not allowed in code signed
PIE ...
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: dominiq at lps dot ens.fr
CC: iains at gcc dot gnu.org, janus at gcc dot gnu.org
Host: x86_64-apple-darwin1(2|3)
Target: x86_64-apple-darwin1(2|3)
Build: x86_64-apple-darwin1(2|3)
For the code at http://gcc.gnu.org/ml/fortran/2014-01/msg00080.html and the
modified one below
module F03_ISO_C
use, intrinsic :: iso_c_binding
contains
integer(c_int) function compute() bind(c) result(compute)
use, intrinsic :: iso_c_binding
implicit none
compute = 1
return
end function compute
integer function F03_ISO_C_init()
! use F03_ISO_C
use, intrinsic :: iso_c_binding
implicit none
call USE_FUNC_PTR(c_funloc(compute))
F03_ISO_C_init = 1
return
end function F03_ISO_C_init
subroutine USE_FUNC_PTR(f1)
use, intrinsic :: iso_c_binding
implicit none
type(c_funptr) :: f1
print *, f1, "is the address"
end subroutine USE_FUNC_PTR
end module F03_ISO_C
use F03_ISO_C
use, intrinsic :: iso_c_binding
implicit none
integer :: i
i = F03_ISO_C_init()
print *, i
end
the darwin1(2|3) linker emits the warning
ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not
allowed in code signed PIE, but used in anon from
/var/folders/8q/sh_swgz96r7f5vnn08f7fxr00000gn/T//ccA26PZ2.o. To fix this
warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
while the output for the above test is
4294970677 is the address
1
Compiling the tests with -Wl,-no_pie silences the warning as advertised without
changing the output.