This is the mail archive of the 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]

Re: Special names tha ld needs to recognize for hppa64-hp-hpux11.X

> I have looked a bit more into this problem and it appears more difficult
> to solve than first thought.  We can't just provide these symbols because
> they are provided by the dynamic loader.  Because static linking still
> produces a "dynamic" binary, we need to allow undefined dynamic-loader
> absolute symbols in static links.  This is what the HP linker does.
> If we produced a true static binary, the linker would have to provide
> these symbols.

I have done some debugging of the problem.  The segmentation fault isn't
related to the linker defined symbols under hppa64-hp-hpux11.11.

The following program seg faults when it exits:

main () { exit (0); }

bash-2.05$ gcc -g -static -o main main.c
bash-2.05$ ./main
Segmentation fault (core dumped)

The problem is this code in the exitcu.o module:

   8:   2b 60 00 00     addil 0,dp,%r1
			8: R_PARISC_LTOFF_FPTR21L       do_exitcu
   c:   50 3a 00 00     ldd 0(r1),r26
			c: R_PARISC_LTOFF_FPTR14DR      do_exitcu

When linked with gnu ld, r26 ends up with actual address of "do_exitcu".
However, r26 should contain the address of the .opd entry for "do_exitcu".  

I don't fully understand the code in elf64-hppa.c but it seems that
there is something tricky going on with respect to the values of symbols
for which there are .opd entries.  Does this ring any bells as to
what's going on?

I also noticed that HP makes the .opd section readonly.

J. David Anglin                        
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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