This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ld -pie -O1: failed to set dynamic section sizes: Invalid operation


Hello,

an error from ld seems to stop glibc from compiling on my arm box
running Gentoo Linux. The compiler is gcc-6.3.0 and binutils are 2.27
and 2.28. Now glibc refuses to compile with error:

pt-vfork.c:41:3: error: #error "must write pt-vfork for this machine or
get IFUNC support"
 # error "must write pt-vfork for this machine or get IFUNC support"

The same version compiled with this compiler and binutils combination
before. I have not yet dug into what changed to make it fail but: It
seems to be because its configure fails to detect STT_GNU_IFUNC support.
The relevant conftest looks like this:

.type foo,%gnu_indirect_function
foo:
.globl _start
_start:
.globl __start
__start:
.data
#ifdef _LP64
.quad foo
#else
.long foo
#endif

After compiling into an object file with just cc -o t.o -c t.S, ld throws
the following error on linking:

# ld -o t t.o -v -pie -O1
GNU ld (Gentoo 2.28 p1.1) 2.28
/usr/bin/ld: failed to set dynamic section sizes: Invalid operation
# 

It works if I remove either -pie or -O1:

# ld -o t t.o -v -O1
GNU ld (Gentoo 2.28 p1.1) 2.28
# /usr/bin/ld -o t t.o -v -pie
GNU ld (Gentoo 2.28 p1.1) 2.28
# 

Is this combination of -pie and -O1 supposed to work?

I found bug #17841 which seems to have dealt with -pie when building
glibc but does not mention -O1 and is a couple of years old. My gcc is
indeed defaulting to -pie (Gentoo hardened).
-- 
Thanks in advance,
Michael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]