Skip to contentSkip to conversation

binutils 2.15?

parisc-linux Joel Soete 5 participants 5 messages Jun 13, 2004 – Jun 21, 2004 3 messages not in the archive

lore
Share & tools
lore

Joel Soete

author
#0 lore raw

Hi all,

I read that now many arch try to update their toolchain to a new release;=

I so try to rebuild toolchain starting from binutils-2.15 (.0.91... from ftp.kernel.org)
it build well but when I launch to rebuild gcc with those new binutil con= figure
crashes immediately with:
"/usr/bin/ld: .got section not immediately after .plt section"

What do I mess and forget?

TIA,
Joel

-------------------------------------------------------------------------=
---------------
Tiscali ADSL, 27,50 =80/mois...pendant 6 mois.
La meilleure offre du march=E9 !
http://reg.tiscali.be/default.asp?lg=3Dfr

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

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

#2 lore raw
Quoted 8 lines · John David Anglin
Quoted 6 lines

I read that now many arch try to update their toolchain to a new release; I so try to rebuild toolchain starting from binutils-2.15 (.0.91... from ftp.kernel.org)
it build well but when I launch to rebuild gcc with those new binutil configure crashes immediately with:
"/usr/bin/ld: .got section not immediately after .plt section"

The following change appears to have introduced this problem:

First of all, can you explain why hppa needs .got after .plt?

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

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

#4 lore raw
Quoted 1 line · Jakub Jelinek

First of all, can you explain why hppa needs .got after .plt?

There's a lazy linking stub inserted at the end of the .plt section that loads the .got address by

b,l 1b,%r20
depi 0,31,2,%r20

ie. it depends on .got immediately following these instructions.

Signature · 6 lines
Alan Modra
IBM OzLabs - Linux Technology Centre
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

#6 lore raw
Quoted 7 lines

There's a lazy linking stub inserted at the end of the .plt section that loads the .got address by

b,l 1b,%r20
depi 0,31,2,%r20

ie. it depends on .got immediately following these instructions.

My apologies for a tardy reply.

We don't *have* to depend on the .got immediately following these instructions. Technically we look for a signature at the end of the PLT. The code in glibc looks beyond the last relocation in the following equation:

ptr = reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB

And if it finds the signature at ptr[-2] and ptr[-1], then it acknowledges that as the PLT stub. It then by proxy knows that the GOT should be at ptr[0], but it doesn't have to rely strictly on this, I'm more than willing to add more code to glibc to remove this restriction.

I just don't really know how other arches find the GOT at this early stage in ld.so's startup (e.g. elf_machine_runtime_setup()).

The only reason we use the GOT here is because we want to identify the shared object by storing a pointer to the DSO link_map into GOT[1]. Which to tell you the truth, I'm sure has to do with something in binutils that I currently don't understand.

I'm slowly reviewing the binutils hppa code because I'd like to clean it up / understand it enough to add TLS.

Jakub, I hope this helps, if someone has an idea then I would be more than happy to implement the change and test the resulting binutils/glibc.

Cheers,
Carlos.

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

#7 lore raw
In reply to Joel Soete
Quoted 6 lines

I read that now many arch try to update their toolchain to a new release; I so try to rebuild toolchain starting from binutils-2.15 (.0.91... from ftp.kernel.org)
it build well but when I launch to rebuild gcc with those new binutil configure crashes immediately with:
"/usr/bin/ld: .got section not immediately after .plt section"

The following change appears to have introduced this problem:

CVSROOT:        /cvs/src
Module name:    src
Changes by:     [email protected]    2004-05-11 17:08:32

Modified files:

	bfd            : ChangeLog 
	include        : ChangeLog 
	binutils       : ChangeLog 

Log message:
bfd/
* elflink.c (elf_bfd_final_link): Don't output STT_SECTION symbol into .dynsym if elf_section_data (sec)->dynindx <= 0. Adjust counting of last_local. (_bfd_elf_link_renumber_dynsyms): Don't assign dynindx to sections other than SHT_PROGBITS/SHT_NOBITS and neither for .got/.got.plt/.plt created by the linker nor !SHF_ALLOC.

* elf32-i386.c (elf_i386_finish_dynamic_sections): Point DT_PLTGOT to the start of the .got.plt section instead of the .got output section. Set sh_entsize for .got section in addition to .got.plt.
...

Dave

Signature · 6 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
[email protected]
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux