[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on functi
From: |
danglin at gcc dot gnu.org |
Subject: |
[Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization |
Date: |
Sat, 04 Nov 2017 15:56:54 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22394
--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> ---
Hi Alan,
Although your example is not technically supported, I think it should
work on linux because it doesn't use the PIC register and because of the
flat address space.
First, calls to functions in shared libraries are not supported using the
-mfast-indirect-calls gcc option:
@item -mfast-indirect-calls
@opindex mfast-indirect-calls
Generate code that assumes calls never cross space boundaries. This
allows GCC to emit code that performs faster indirect calls.
This option does not work in the presence of shared libraries or nested
functions.
What works is:
$ gcc -o funcp funcp.c funcpdef.c -mfast-indirect-calls
$ ./funcp
$
Issues are the space register used for the call and the PIC register.
Looking at your example, it seems to me that R_PARISC_DIR32 relocations
are not handled correctly when they refer to a function. This is the
assembly code:
.LEVEL 1.1
.globl fp
.section .data.rel,"aw",@progbits
.align 4
.type fp, @object
.size fp, 4
fp:
.word foo
At runtime, fp is NULL causing the segmentation fault. So, I agree
with your assessment.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/22394] New: hppa-linux-ld fails to emit dynamic relocations on function pointer initialization, amodra at gmail dot com, 2017/11/03
- [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization, amodra at gmail dot com, 2017/11/03
- [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization, amodra at gmail dot com, 2017/11/03
- [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization,
danglin at gcc dot gnu.org <=
- [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization, danglin at gcc dot gnu.org, 2017/11/04
- [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization, danglin at gcc dot gnu.org, 2017/11/04
- [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization, cvs-commit at gcc dot gnu.org, 2017/11/04
- [Bug ld/22394] hppa-linux-ld fails to emit dynamic relocations on function pointer initialization, amodra at gmail dot com, 2017/11/04