From 390a1432f0832236ae7bcb71c493755c93997088 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 8 Nov 2006 11:29:16 +0000 Subject: ld/ * emultempl/elf32.em (gld*_before_allocation): Adjust output section size for warning sections. ld/testsuite/ * ld-elf/group.ld: Handle .rodata.brlt for powerpc64. --- ld/ChangeLog | 9 +++++++-- ld/emultempl/elf32.em | 15 +++++++++++---- ld/testsuite/ChangeLog | 8 ++++++-- ld/testsuite/ld-elf/group.ld | 2 +- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index f3e1383834..7f838f627f 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,7 +1,12 @@ +2006-11-08 Alan Modra + + * emultempl/elf32.em (gld*_before_allocation): Adjust output section + size for warning sections. + 2006-11-06 Vladimir Prus - * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): - Don't prepend "warning" to the message. + * emultempl/elf32.em (gld*_before_allocation): Don't prepend + "warning" to the message. 2006-10-31 Pedro Alves diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em index ff48c56687..03d9d8d5ae 100644 --- a/ld/emultempl/elf32.em +++ b/ld/emultempl/elf32.em @@ -1204,12 +1204,19 @@ ${ELF_INTERPRETER_SET_DEFAULT} ASSERT (ret); free (msg); - /* Clobber the section size, so that we don't waste copying the - warning into the output file. */ + /* Clobber the section size, so that we don't waste space + copying the warning into the output file. If we've already + sized the output section, adjust its size. The adjustment + is on rawsize because targets that size sections early will + have called lang_reset_memory_regions after sizing. */ + if (s->output_section != NULL + && s->output_section->rawsize >= s->size) + s->output_section->rawsize -= s->size; + s->size = 0; - /* Also set SEC_EXCLUDE, so that symbols defined in the warning - section don't get copied to the output. */ + /* Also set SEC_EXCLUDE, so that local symbols defined in the + warning section don't get copied to the output. */ s->flags |= SEC_EXCLUDE | SEC_KEEP; } } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index 86b084e6dd..397caa11e3 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,7 +1,11 @@ +2006-11-08 Alan Modra + + * ld-elf/group.ld: Handle .rodata.brlt for powerpc64. + 2006-11-07 Vladimir Prus - * testsuite/ld-elf/symbol2w.s: Use "%" instead - of "@" to avoid breakage on ARM. + * testsuite/ld-elf/symbol2w.s: Use "%" instead of "@" to avoid + breakage on ARM. 2006-11-06 Vladimir Prus diff --git a/ld/testsuite/ld-elf/group.ld b/ld/testsuite/ld-elf/group.ld index d6b27d0494..71852745b6 100644 --- a/ld/testsuite/ld-elf/group.ld +++ b/ld/testsuite/ld-elf/group.ld @@ -1,5 +1,5 @@ SECTIONS { . = 0x1000; - .text : { *(.text) } + .text : { *(.text) *(.rodata.brlt) } } -- cgit v1.2.1