ld -r breakage

Alan Modra alan@linuxcare.com.au
Mon Jun 12 21:37:00 GMT 2000


On Mon, 12 Jun 2000, Nick Clifton wrote:

> OK, but I still think that the reason that 'ld -r' does not change the
> SEC_READONLY attribute of the text section should be a consequence of
> the fact that config.text_read_only is true, and not of the fact that
> link_info.relocatable is true.

Hmm.  We started with (1)
config.text_read_only true => make .text read only
config.text_read_only false => don't change .text attributes

This was buggy because "ld -N" needs to mark .text read/write

Then we went to (2)
config.text_read_only true => make .text read only
config.text_read_only false => make .text read/write

This is again incorrect because "ld -r" cleared config.text_read_only so
as to leave the section attributes unchanged as per (1).  Under (2), we
get a read/write .text section.

I suggested testing link_info.relocatable so that "ld -r" would again
leave the section attributes unchanged.  It's true that the patch I
submitted should have removed the unnecessary clearing of
config.text_read_only for `-r' (and `-Ur').

Now you seem to be saying (3)
config.text_read_only true => don't change .text attributes
config.text_read_only false => make .text read/write

??

-- 
Linuxcare.  Support for the Revolution.



More information about the Binutils mailing list