This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: ld/1467: Orphaned section is put in the odd place
On Wed, Oct 12, 2005 at 07:09:24PM +0100, Nick Clifton wrote:
> Hi H. J.
>
> >The old section order is
> > [ 1] .text PROGBITS 0000000000000000 00100000
> > [ 2] .data PROGBITS 0000000000000004 00100004
> > [ 3] .note NOTE 0000000000000008 00100008
> > [ 4] .notbad PROGBITS 000000000000000c 0010000c
> > [ 5] .note.bar NOTE 0000000000000010 00100010
>
> Why is this a problem ?
The question is which one is more reasonable,
[ 1] .text PROGBITS 0000000000000000 00100000
0000000000000004 0000000000000000 AX 0 0 4
[ 2] .data PROGBITS 0000000000000004 00100004
0000000000000004 0000000000000000 WA 0 0 4
[ 3] .note NOTE 0000000000000008 00100008
0000000000000004 0000000000000000 A 0 0 1
[ 4] .notbad PROGBITS 000000000000000c 0010000c
0000000000000004 0000000000000000 A 0 0 1
[ 5] .note.bar NOTE 0000000000000010 00100010
0000000000000004 0000000000000000 A 0 0 1
or
[ 1] .text PROGBITS 0000000000000000 00100000
0000000000000004 0000000000000000 AX 0 0 4
[ 2] .notbad PROGBITS 0000000000000004 00100004
0000000000000004 0000000000000000 A 0 0 1
[ 3] .data PROGBITS 0000000000000008 00100008
0000000000000004 0000000000000000 WA 0 0 4
[ 4] .note NOTE 000000000000000c 0010000c
0000000000000004 0000000000000000 A 0 0 1
[ 5] .note.bar NOTE 0000000000000010 00100010
0000000000000004 0000000000000000 A 0 0 1
When I repalce .notbad with .readonlydata, the old linker gives me
[ 1] .text PROGBITS 0000000000000000 00100000
0000000000000004 0000000000000000 AX 0 0 4
[ 2] .data PROGBITS 0000000000000004 00100004
0000000000000004 0000000000000000 WA 0 0 4
[ 3] .note NOTE 0000000000000008 00100008
0000000000000004 0000000000000000 A 0 0 1
[ 4] .readonlydata PROGBITS 000000000000000c 0010000c
0000000000000004 0000000000000000 A 0 0 1
[ 5] .note.bar NOTE 0000000000000010 00100010
0000000000000004 0000000000000000 A 0 0 1
Are you saying it is better than the new linker
[ 1] .text PROGBITS 0000000000000000 00100000
0000000000000004 0000000000000000 AX 0 0 4
[ 2] .readonlydata PROGBITS 0000000000000004 00100004
0000000000000004 0000000000000000 A 0 0 1
[ 3] .data PROGBITS 0000000000000008 00100008
0000000000000004 0000000000000000 WA 0 0 4
[ 4] .note NOTE 000000000000000c 0010000c
0000000000000004 0000000000000000 A 0 0 1
[ 5] .note.bar NOTE 0000000000000010 00100010
>
> Why should the user expect any kind of ordering for orphaned sections ?
> If they did not care enough about the sections to place them in their
> linker script, why should they complain about how or where the linker
> chooses to place them ?
> What if the user wants this kind of alphabetic ordering ? Will your
> patch allow it ?
We are talking about orphaned sections here. User isn't clear where
they should go.
H.J.