Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Malloc, free?

93 views
Skip to first unread message

Dieter Britz

unread,
Jun 6, 2021, 9:05:04 AM6/6/21
to
When I run a certain program, I get these lines of output:

./findI0.out: Symbol `malloc' causes overflow in R_X86_64_PC32 relocation
./findI0.out: Symbol `malloc' causes overflow in R_X86_64_PC32 relocation
./findI0.out: Symbol `free' causes overflow in R_X86_64_PC32 relocation
./findI0.out: Symbol `free' causes overflow in R_X86_64_PC32 relocation

The program does not use these symbols. What is this telling me?

--
Dieter Britz

Robin Vowels

unread,
Jun 6, 2021, 9:46:38 AM6/6/21
to
.
What language? What compiler?

Steve Lionel

unread,
Jun 6, 2021, 9:52:44 AM6/6/21
to
You may not use these symbols, but the Fortran language support library
does, as might some other library you are linking to. The message is
telling you that the executable loader is unable to resolve an address
reference in a compiled library. Some web searches I find recommend
making sure that any static libraries are compiled with -fpic. I have
also seen -no-pie referenced. A lot depends on which distro you are running.

https://stackoverflow.com/questions/43367427/32-bit-absolute-addresses-no-longer-allowed-in-x86-64-linux
seems relevant.

--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org

Dieter Britz

unread,
Jun 7, 2021, 5:16:14 AM6/7/21
to
On Sun, 06 Jun 2021 09:52:38 -0400, Steve Lionel wrote:

> On 6/6/2021 9:05 AM, Dieter Britz wrote:
>> When I run a certain program, I get these lines of output:
>>
>> ./findI0.out: Symbol `malloc' causes overflow in R_X86_64_PC32
>> relocation ./findI0.out: Symbol `malloc' causes overflow in
>> R_X86_64_PC32 relocation ./findI0.out: Symbol `free' causes overflow in
>> R_X86_64_PC32 relocation ./findI0.out: Symbol `free' causes overflow in
>> R_X86_64_PC32 relocation
>>
>> The program does not use these symbols. What is this telling me?
>>
>>
> You may not use these symbols, but the Fortran language support library
> does, as might some other library you are linking to. The message is
> telling you that the executable loader is unable to resolve an address
> reference in a compiled library. Some web searches I find recommend
> making sure that any static libraries are compiled with -fpic. I have
> also seen -no-pie referenced. A lot depends on which distro you are
> running.
>
> https://stackoverflow.com/questions/43367427/32-bit-absolute-addresses-
no-longer-allowed-in-x86-64-linux
> seems relevant.

Sorry, yes, this is Fortran (90) and gnufortran. I recompiled a certain
subroutine and that message disappeared. I was probably using an old
outdated object file.

But now I get this after a successful execution:
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-140-*-*-P-
*-ISO8859-1" to type FontStruct
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-120-*-*-P-
*-ISO8859-1" to type FontStruct
Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-100-*-*-P-
*-ISO8859-1" to type FontStruct
Warning: Cannot convert string "-*-Helvetica-Bold-R-Normal--*-120-*-*-P-*-
ISO8859-1" to type FontStruct

Now what?
--
Dieter Britz

eugene_...@yahoo.com

unread,
Jun 7, 2021, 8:35:11 AM6/7/21
to
On Monday, June 7, 2021 at 5:16:14 AM UTC-4, Dieter Britz wrote:

> But now I get this after a successful execution:
> Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-140-*-*-P-
> *-ISO8859-1" to type FontStruct
> Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-120-*-*-P-
> *-ISO8859-1" to type FontStruct
> Warning: Cannot convert string "-*-Helvetica-Medium-R-Normal--*-100-*-*-P-
> *-ISO8859-1" to type FontStruct
> Warning: Cannot convert string "-*-Helvetica-Bold-R-Normal--*-120-*-*-P-*-
> ISO8859-1" to type FontStruct
>
> Now what?

Is your program a GUI program? This looks like a fonts issue, coming from X.

--Eugene

gah4

unread,
Jun 7, 2021, 10:55:22 AM6/7/21
to
On Sunday, June 6, 2021 at 6:52:44 AM UTC-7, Steve Lionel wrote:
> On 6/6/2021 9:05 AM, Dieter Britz wrote:

(snip)
> > ./findI0.out: Symbol `free' causes overflow in R_X86_64_PC32 relocation
> > ./findI0.out: Symbol `free' causes overflow in R_X86_64_PC32 relocation

> > The program does not use these symbols. What is this telling me?

> You may not use these symbols, but the Fortran language support library
> does, as might some other library you are linking to. The message is
> telling you that the executable loader is unable to resolve an address
> reference in a compiled library. Some web searches I find recommend
> making sure that any static libraries are compiled with -fpic. I have
> also seen -no-pie referenced. A lot depends on which distro you are running.

> https://stackoverflow.com/questions/43367427/32-bit-absolute-addresses-no-longer-allowed-in-x86-64-linux
> seems relevant.

I do remember when PIC was needed for dynamic linked code, but not
static linked, since dynamic linked code doesn't know that address it will
end up in.

In this case, as you might guess from the message, it is related to the transition
from 32 bit to 64 bit code.

If everything and everyone went to 64 bits, all would be fine. But even when using
very large amounts of data, one does not usually need more than 2GB of code,
and so code still wants to use 32 bit addresses. Using relative addressing,
you can still use 32 bit offsets, even if the code is actually loaded above 2GB.

I am not sure now which OS will still run 32 bit code, or which compilers
will generate it. I suspect that a large number of programs would still be
fine in 32 bits.


0 new messages