Skip to contentSkip to conversation

Getting PIE to work (was How to reclaim .rela.dyn entries for symbols that become hidden?)

parisc-linux Mike Frysinger 3 participants 5 messages Jul 7, 2005 – Jul 8, 2005 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 16 lines · Carlos O'Donell

An example executable might look like this:

Relocation section '.rela.dyn' at offset 0x2fc contains 11 entries:
Offset Info Type Sym.Value Sym. Name + Addend

00000000  00000000 R_PARISC_NONE                                00000000
00000000  00000000 R_PARISC_NONE                                00000000
00000000  00000000 R_PARISC_NONE                                00000000
00000000  00000000 R_PARISC_NONE                                00000000
00010420  00000542 R_PARISC_PLABEL21 0001054c   main + 0
00010424  00000546 R_PARISC_PLABEL14 0001054c   main + 0
00010430  00000442 R_PARISC_PLABEL21 000106e0   __libc_csu_init + 0
00010434  00000446 R_PARISC_PLABEL14 000106e0   __libc_csu_init + 0
00010438  00000242 R_PARISC_PLABEL21 00010770   __libc_csu_fini + 0
0001043c  00000246 R_PARISC_PLABEL14 00010770   __libc_csu_fini + 0
000108b4  00000841 R_PARISC_PLABEL32 00000000   _Jv_RegisterClasses + 0
Quoted 3 lines

Lets not worry about wether this is optimal (It's not and the fix is to change glibc/sysdeps/hppa/start.S to use plabel words so these become 1 reloc each).

does that mean you're looking into fixing PIE on parisc ? we noticed in Gentoo that nscd fails to run since glibc forces it to either be built as a PIE or not at all:
root@mindcircus 0 ~ # nscd
nscd: error while loading shared libraries: unexpected reloc type 0x42

building anything as PIE fails due to this reloc ... looks like binutils generates relocs of type R_PARISC_PLABEL14 and R_PARISC_PLABEL21 but glibc only knows how to handle R_PARISC_PLABEL32 ...
-mike
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#2 lore raw
Quoted 9 lines

does that mean you're looking into fixing PIE on parisc ? we noticed in Gentoo that nscd fails to run since glibc forces it to either be built as a PIE or not at all:
root@mindcircus 0 ~ # nscd
nscd: error while loading shared libraries: unexpected reloc type 0x42

building anything as PIE fails due to this reloc ... looks like binutils generates relocs of type R_PARISC_PLABEL14 and R_PARISC_PLABEL21 but glibc only knows how to handle R_PARISC_PLABEL32 ...

palinux glibc cvs has patch to do this. We'll propagate this upstream.

randolph

Signature · 8 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#3 lore raw
Quoted 11 lines · Randolph Chung
Quoted 9 lines

does that mean you're looking into fixing PIE on parisc ? we noticed in Gentoo that nscd fails to run since glibc forces it to either be built as a PIE or not at all:
root@mindcircus 0 ~ # nscd
nscd: error while loading shared libraries: unexpected reloc type 0x42

building anything as PIE fails due to this reloc ... looks like binutils generates relocs of type R_PARISC_PLABEL14 and R_PARISC_PLABEL21 but glibc only knows how to handle R_PARISC_PLABEL32 ...

palinux glibc cvs has patch to do this. We'll propagate this upstream.

ah, was not aware parisc kept a glibc cvs tree

thanks for the great news :)
-mike
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

#4 lore raw
Quoted 1 line

ah, was not aware parisc kept a glibc cvs tree

we just added this recently to work on TLS.

I realized after I sent that last email that the pie patch probably has some other dependencies so it may take some time to get it upstream. If you want to look the changes are all in dl-machine.h

randolph

Signature · 8 lines
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
#5 lore raw
In reply to Mike Frysinger
Quoted 11 lines · Mike Frysinger
Quoted 10 lines · Randolph Chung
Quoted 9 lines

does that mean you're looking into fixing PIE on parisc ? we noticed in Gentoo that nscd fails to run since glibc forces it to either be built as a PIE or not at all:
root@mindcircus 0 ~ # nscd
nscd: error while loading shared libraries: unexpected reloc type 0x42

building anything as PIE fails due to this reloc ... looks like binutils generates relocs of type R_PARISC_PLABEL14 and R_PARISC_PLABEL21 but glibc only knows how to handle R_PARISC_PLABEL32 ...

Quoted 5 lines
Quoted 1 line

palinux glibc cvs has patch to do this. We'll propagate this upstream.

ah, was not aware parisc kept a glibc cvs tree

thanks for the great news :)

We haven't pulled from upstream since 2005-06-08. We are trying to get a working TLS build :)

c.

_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux