NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-vax/46715: Relocation in .text section in vax does not work



On Jul 17, 2012, at 2:22 PM, Christos Zoulas wrote:

> On Jul 17,  4:00pm, paulkoning%comcast.net@localhost 
> (paulkoning%comcast.net@localhost) wrote:
> -- Subject: port-vax/46715: Relocation in .text section in vax does not work
> 
> The bug could be in many places, but not in ld.elf_so:
> 1. If the source is compiled with -fPIC or -fpic, then it should not emit
>   R_VAX_32; if it does then it is an assembler bug.

In the sample program (bug.s) I supplied, the code as written is clearly not 
PIC.  And when assembling it, I didn't say -fpic or -fPIC, so I told the tool 
correctly.

> 2. If the source is not compiled with -fPIC or -fpic, then it is ok to
>   emit R_VAX_32, but but then the linker should mark the object with
>   DT_TEXTREL so that the rtld knows to mmap the text writable before
>   doing relocations.

Where would I look for a DT_TEXTREL marking?  objdump -R shows just a single 
entry, which is the one that is causing things to blow up.

> Can you investigate who is at fault? The package for not passing -f{PIC,pic}?
> The assembler/linker? Both?

Sounds like the linker.  For one thing, if it can give instructions to the 
loader on how to do the right thing, it should do so without spitting out 
confusing warnings.

ld is the one that comes stock with 5.1 -- "version 2.16.1 20051220".

        paul



Home | Main Index | Thread Index | Old Index