* [parisc-linux] klibc parisc64
@ 2006-07-24 18:27 Kyle McMartin
2006-07-24 19:01 ` John David Anglin
0 siblings, 1 reply; 11+ messages in thread
From: Kyle McMartin @ 2006-07-24 18:27 UTC (permalink / raw)
To: parisc-linux; +Cc: klibc
I hacked out a rough first implementation of parisc64 for klibc
last month, and only just got around to testing it now.
The good news, it compiled fine on the first shot. The bad news,
it failed to link usr/klibc/libc.so, and I'm not clueful enough
to know why.
hppa64-linux-gnu-ld -Ttext 0x40001000 -o usr/klibc/libc.so --start-group
[...]
usr/klibc/socketcalls/recvmsg.o /usr/lib/gcc/hppa64-linux-gnu/4.1.2/libgcc.a --end-group
hppa64-linux-gnu-ld: warning: cannot find entry symbol main; defaulting to 0000000040001000
hppa64-linux-gnu-ld: usr/klibc/libc.so: Not enough room for program headers (allocated 5, need 6)
Section to Segment mapping:
Segment Sections...
00: PHDR:
01: INTERP: .interp
02: LOAD: .interp .dynamic .hash .dynsym .dynstr
03: LOAD: .text .rodata .PARISC.unwind .eh_frame
04: LOAD: .data.rel.ro .data .opd .dlt .bss
05: DYNAMIC: .dynamic
hppa64-linux-gnu-ld: final link failed: Bad value
make[2]: *** [usr/klibc/libc.so] Error 1
make[1]: *** [all] Error 2
make: *** [klibc] Error 2
You can fetch it from
git://git.kernel.org/pub/scm/linux/kernel/git/kyle/klibc-parisc64.git,
and compile it with:
make CROSS_COMPILE=hppa64-linux-gnu- ARCH=parisc64 V=1
(It seemed to build without warning on my Debian etch rp2470)
Any hints would be appreciated.
Cheers,
Kyle M.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [parisc-linux] klibc parisc64
2006-07-24 18:27 [parisc-linux] klibc parisc64 Kyle McMartin
@ 2006-07-24 19:01 ` John David Anglin
2006-07-24 19:28 ` Kyle McMartin
2006-07-24 19:35 ` John David Anglin
0 siblings, 2 replies; 11+ messages in thread
From: John David Anglin @ 2006-07-24 19:01 UTC (permalink / raw)
To: Kyle McMartin; +Cc: klibc, parisc-linux
> The good news, it compiled fine on the first shot. The bad news,
> it failed to link usr/klibc/libc.so, and I'm not clueful enough
> to know why.
>
> hppa64-linux-gnu-ld -Ttext 0x40001000 -o usr/klibc/libc.so --start-group
> [...]
> usr/klibc/socketcalls/recvmsg.o /usr/lib/gcc/hppa64-linux-gnu/4.1.2/libgcc.a --end-group
> hppa64-linux-gnu-ld: warning: cannot find entry symbol main; defaulting to 0000000040001000
> hppa64-linux-gnu-ld: usr/klibc/libc.so: Not enough room for program headers (allocated 5, need 6)
> Section to Segment mapping:
> Segment Sections...
> 00: PHDR:
> 01: INTERP: .interp
> 02: LOAD: .interp .dynamic .hash .dynsym .dynstr
> 03: LOAD: .text .rodata .PARISC.unwind .eh_frame
> 04: LOAD: .data.rel.ro .data .opd .dlt .bss
> 05: DYNAMIC: .dynamic
> hppa64-linux-gnu-ld: final link failed: Bad value
This is a ld bug. I see the same problem on hpux with '-static'. We
need another program header sometimes and I haven't figured out why.
I had a hack on my A500 that I might be able to find but it's down at
the moment.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [parisc-linux] klibc parisc64
2006-07-24 19:01 ` John David Anglin
@ 2006-07-24 19:28 ` Kyle McMartin
2006-07-24 19:50 ` John David Anglin
2006-07-24 19:35 ` John David Anglin
1 sibling, 1 reply; 11+ messages in thread
From: Kyle McMartin @ 2006-07-24 19:28 UTC (permalink / raw)
To: John David Anglin; +Cc: klibc, parisc-linux, Kyle McMartin
On Mon, Jul 24, 2006 at 03:01:36PM -0400, John David Anglin wrote:
> > hppa64-linux-gnu-ld: usr/klibc/libc.so: Not enough room for program headers (allocated 5, need 6)
[...]
> > hppa64-linux-gnu-ld: final link failed: Bad value
>
> This is a ld bug. I see the same problem on hpux with '-static'. We
> need another program header sometimes and I haven't figured out why.
>
So, klibc linked statically (libc.a) properly...
Interesting. So I fetched the cmdline used to build some of the static
test programs from klibc out of a 32-bit parisc build, and edited them
in the relevant ways to build for 64-bit. The outputted executable when
examined with "file" claimed to be "dynamically linked (uses shared libs)"
and would return "No such file or directory" when executed, implying that
it wasn't linked properly.
However, examination with readelf seemed to be alright.
I can provide the test built program (minips).
Cheers,
Kyle M.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [parisc-linux] klibc parisc64
2006-07-24 19:28 ` Kyle McMartin
@ 2006-07-24 19:50 ` John David Anglin
0 siblings, 0 replies; 11+ messages in thread
From: John David Anglin @ 2006-07-24 19:50 UTC (permalink / raw)
To: Kyle McMartin; +Cc: klibc, parisc-linux, kyle
> Interesting. So I fetched the cmdline used to build some of the static
> test programs from klibc out of a 32-bit parisc build, and edited them
> in the relevant ways to build for 64-bit. The outputted executable when
> examined with "file" claimed to be "dynamically linked (uses shared libs)"
> and would return "No such file or directory" when executed, implying that
> it wasn't linked properly.
Under hpux, non-dynamic executables aren't supported (i.e., we always
need an interpreter). The dynamic loader defines some linker-defined
symbols that we don't have support for in the linker itself. There may
be other reasons...
Thus, dynamically linked doesn't imply the presence of shared libraries.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [parisc-linux] klibc parisc64
2006-07-24 19:01 ` John David Anglin
2006-07-24 19:28 ` Kyle McMartin
@ 2006-07-24 19:35 ` John David Anglin
2006-07-24 22:41 ` [klibc] " H. Peter Anvin
1 sibling, 1 reply; 11+ messages in thread
From: John David Anglin @ 2006-07-24 19:35 UTC (permalink / raw)
To: John David Anglin; +Cc: klibc, parisc-linux, kyle
> > hppa64-linux-gnu-ld: usr/klibc/libc.so: Not enough room for program headers (allocated 5, need 6)
Additional phdrs are provided by elf64_hppa_additional_program_headers
in bfd/elf64-hppa.c. The code doesn't expect a .interp section in
a shared library. That would appear to be the problem here.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [klibc] [parisc-linux] klibc parisc64
2006-07-24 19:35 ` John David Anglin
@ 2006-07-24 22:41 ` H. Peter Anvin
2006-07-24 22:55 ` H. Peter Anvin
0 siblings, 1 reply; 11+ messages in thread
From: H. Peter Anvin @ 2006-07-24 22:41 UTC (permalink / raw)
To: John David Anglin; +Cc: klibc, parisc-linux
John David Anglin wrote:
>>> hppa64-linux-gnu-ld: usr/klibc/libc.so: Not enough room for program headers (allocated 5, need 6)
>
> Additional phdrs are provided by elf64_hppa_additional_program_headers
> in bfd/elf64-hppa.c. The code doesn't expect a .interp section in
> a shared library. That would appear to be the problem here.
>
(k)libc.so isn't a shared library in the ELF sense. It's an executable.
klibc doesn't do dynamic linking at all. As Dave said, dynamically
linked doesn't imply the presence of shared libraries; the converse is
also true.
-hpa
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [klibc] [parisc-linux] klibc parisc64
2006-07-24 22:41 ` [klibc] " H. Peter Anvin
@ 2006-07-24 22:55 ` H. Peter Anvin
2006-07-24 23:11 ` John David Anglin
0 siblings, 1 reply; 11+ messages in thread
From: H. Peter Anvin @ 2006-07-24 22:55 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: John David Anglin, klibc, parisc-linux
H. Peter Anvin wrote:
>
> (k)libc.so isn't a shared library in the ELF sense. It's an executable.
>
... specifically, as far as ELF (and the kernel) is concerned, it's the
ELF interpreter; it's linked at a fixed address and the application
invokes it with usual static jumps.
Very similar to old Linux a.out stuff. Messy and primitive, but very fast.
-hpa
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [klibc] [parisc-linux] klibc parisc64
2006-07-24 22:55 ` H. Peter Anvin
@ 2006-07-24 23:11 ` John David Anglin
2006-07-24 23:17 ` H. Peter Anvin
0 siblings, 1 reply; 11+ messages in thread
From: John David Anglin @ 2006-07-24 23:11 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: klibc, parisc-linux, hpa
> H. Peter Anvin wrote:
> >
> > (k)libc.so isn't a shared library in the ELF sense. It's an executable.
> >
>
> ... specifically, as far as ELF (and the kernel) is concerned, it's the
> ELF interpreter; it's linked at a fixed address and the application
> invokes it with usual static jumps.
"Usual static jumps"? There's nothing usual about static jumps on
the PA ;( However, it should be possible to jump to a static address
with the right setup.
The 64-bit linker hasn't really been ported to linux. The interpreter
section is hardcoded to ELF_DYNAMIC_INTERPRETER:
#define ELF_DYNAMIC_INTERPRETER "/usr/lib/pa20_64/dld.sl"
/* Set the contents of the .interp section to the interpreter. */
if (info->executable)
{
s = bfd_get_section_by_name (dynobj, ".interp");
BFD_ASSERT (s != NULL);
s->size = sizeof ELF_DYNAMIC_INTERPRETER;
s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
}
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [klibc] [parisc-linux] klibc parisc64
2006-07-24 23:11 ` John David Anglin
@ 2006-07-24 23:17 ` H. Peter Anvin
2006-07-25 1:46 ` Kyle McMartin
0 siblings, 1 reply; 11+ messages in thread
From: H. Peter Anvin @ 2006-07-24 23:17 UTC (permalink / raw)
To: John David Anglin; +Cc: klibc, parisc-linux
John David Anglin wrote:
>> H. Peter Anvin wrote:
>>> (k)libc.so isn't a shared library in the ELF sense. It's an executable.
>>>
>> ... specifically, as far as ELF (and the kernel) is concerned, it's the
>> ELF interpreter; it's linked at a fixed address and the application
>> invokes it with usual static jumps.
>
> "Usual static jumps"? There's nothing usual about static jumps on
> the PA ;( However, it should be possible to jump to a static address
> with the right setup.
>
> The 64-bit linker hasn't really been ported to linux. The interpreter
> section is hardcoded to ELF_DYNAMIC_INTERPRETER:
>
> #define ELF_DYNAMIC_INTERPRETER "/usr/lib/pa20_64/dld.sl"
>
> /* Set the contents of the .interp section to the interpreter. */
> if (info->executable)
> {
> s = bfd_get_section_by_name (dynobj, ".interp");
> BFD_ASSERT (s != NULL);
> s->size = sizeof ELF_DYNAMIC_INTERPRETER;
> s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER;
> }
>
OK, well then it's probably pointless to try to get 64-bit klibc up and
running on it at this point. That's fine, though; we can just use 32-bit.
-hpa
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [klibc] [parisc-linux] klibc parisc64
2006-07-24 23:17 ` H. Peter Anvin
@ 2006-07-25 1:46 ` Kyle McMartin
2006-07-25 3:09 ` John David Anglin
0 siblings, 1 reply; 11+ messages in thread
From: Kyle McMartin @ 2006-07-25 1:46 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: John David Anglin, klibc, parisc-linux
On Mon, Jul 24, 2006 at 04:17:13PM -0700, H. Peter Anvin wrote:
> OK, well then it's probably pointless to try to get 64-bit klibc up and
> running on it at this point. That's fine, though; we can just use 32-bit.
>
Just means I need to learn to hack binutils. No big deal. :)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [klibc] [parisc-linux] klibc parisc64
2006-07-25 1:46 ` Kyle McMartin
@ 2006-07-25 3:09 ` John David Anglin
0 siblings, 0 replies; 11+ messages in thread
From: John David Anglin @ 2006-07-25 3:09 UTC (permalink / raw)
To: Kyle McMartin; +Cc: klibc, parisc-linux, H. Peter Anvin
On Mon, Jul 24, 2006 at 09:46:34PM -0400, Kyle McMartin wrote:
> On Mon, Jul 24, 2006 at 04:17:13PM -0700, H. Peter Anvin wrote:
> > OK, well then it's probably pointless to try to get 64-bit klibc up and
> > running on it at this point. That's fine, though; we can just use 32-bit.
> >
>
> Just means I need to learn to hack binutils. No big deal. :)
Patches to clean up the relationship between hpux and linux, and
to define the linux 64-bit runtime are welcome. For example,
we have in hppa64linux.sh:
SCRIPT_NAME=elf
ELFSIZE=64
# FIXME: this output format is for hpux.
OUTPUT_FORMAT="elf64-hppa-linux"
...
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-07-25 3:09 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-24 18:27 [parisc-linux] klibc parisc64 Kyle McMartin
2006-07-24 19:01 ` John David Anglin
2006-07-24 19:28 ` Kyle McMartin
2006-07-24 19:50 ` John David Anglin
2006-07-24 19:35 ` John David Anglin
2006-07-24 22:41 ` [klibc] " H. Peter Anvin
2006-07-24 22:55 ` H. Peter Anvin
2006-07-24 23:11 ` John David Anglin
2006-07-24 23:17 ` H. Peter Anvin
2006-07-25 1:46 ` Kyle McMartin
2006-07-25 3:09 ` John David Anglin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.