Skip to contentSkip to conversation

binutils dhd

DISCUSSION Alan Modra 2 participants 3 messages Sep 26, 2000 – Sep 27, 2000 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]

Alan Modra

author
#1 lore raw
Quoted 4 lines · David Huggins-Daines

Sometimes we get the "split field selectors" problem in import stubs if the distance between the GP and the PLT is not a multiple of 8 bytes. Use alignment constraints on .plt, .got, and .data to fix this.

Ouch. But aligning doesn't fix the problem (well, it may in a particular case). The reason aligning won't always work is that import and long branch stubs are interspersed in the stub section, and PIC long branch stubs happen to be 12 bytes long. Which messes with your carefully constructed 8 byte alignment.

The proper fix is to use lr_sel and rr_sel when building the import stubs, so I'm reverting your change unless you have some other reason for wanting 8 byte alignment.

Alan

Signature · 1 line
Linuxcare.  Support for the Revolution.
author
#2 lore raw
Quoted 7 lines · Alan Modra
Quoted 4 lines · David Huggins-Daines

Sometimes we get the "split field selectors" problem in import stubs if the distance between the GP and the PLT is not a multiple of 8 bytes. Use alignment constraints on .plt, .got, and .data to fix this.

Quoted 5 lines

Ouch. But aligning doesn't fix the problem (well, it may in a particular case). The reason aligning won't always work is that import and long branch stubs are interspersed in the stub section, and PIC long branch stubs happen to be 12 bytes long. Which messes with your carefully constructed 8 byte alignment.

No, that's wrong. Aligning the .plt and gp _will_ fix the problem, but using lrsel/rrsel is still the better solution.

Quoted 5 lines

The proper fix is to use lr_sel and rr_sel when building the import stubs, so I'm reverting your change unless you have some other reason for wanting 8 byte alignment.

Alan

Signature · 1 line
Linuxcare.  Support for the Revolution.
#3 lore raw
In reply to Alan Modra
Quoted 4 lines · Alan Modra

The reason aligning won't always work is that import and long branch stubs are interspersed in the stub section, and PIC long branch stubs happen to be 12 bytes long. Which messes with your carefully constructed 8 byte alignment.

No, the issue is the alignment of the distance between the GP and the PLT, it has nothing to do with the placement of the stubs AFAIK.

Quoted 3 lines

The proper fix is to use lr_sel and rr_sel when building the import stubs, so I'm reverting your change unless you have some other reason for wanting 8 byte alignment.

Okay, so long as this fixes it, I have no objections. My changes were pretty ugly anyway.

Signature · 2 lines
[email protected], http://www.linuxcare.com/
Linuxcare. Support for the revolution.