aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-10-27 04:15:50 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-10-27 04:15:50 +0000
commitd270463e93aa77304932b1df0e2315ec3c0d3be8 (patch)
treee67e248012b72eb596ae1fff6a045cb1aac6732c /bfd
parenta14a5de357808faa8a25d1eff69454a8c0dca8d8 (diff)
downloadgdb-d270463e93aa77304932b1df0e2315ec3c0d3be8.zip
gdb-d270463e93aa77304932b1df0e2315ec3c0d3be8.tar.gz
gdb-d270463e93aa77304932b1df0e2315ec3c0d3be8.tar.bz2
2006-10-26 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_init_private_section_data): Assert output section ELF type instead of check if it is SHT_NULL. Copy OS/PROC specific flags from input section to output section.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf.c14
2 files changed, 17 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 1f8d8f0..1727234 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf.c (_bfd_elf_init_private_section_data): Assert output
+ section ELF type instead of check if it is SHT_NULL. Copy
+ OS/PROC specific flags from input section to output section.
+
2006-10-27 Alan Modra <amodra@bigpond.net.au>
* section.c (SEC_KEEP): Update comment.
diff --git a/bfd/elf.c b/bfd/elf.c
index f2cf85f..24ca6df 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -5950,9 +5950,17 @@ _bfd_elf_init_private_section_data (bfd *ibfd,
output BFD section flags have been set to something different.
elf_fake_sections will set ELF section type based on BFD
section flags. */
- if (osec->flags == isec->flags
- || (osec->flags == 0 && elf_section_type (osec) == SHT_NULL))
- elf_section_type (osec) = elf_section_type (isec);
+ if (osec->flags == isec->flags || !osec->flags)
+ {
+ BFD_ASSERT (osec->flags == isec->flags
+ || (!osec->flags
+ && elf_section_type (osec) == SHT_NULL));
+ elf_section_type (osec) = elf_section_type (isec);
+ }
+
+ /* FIXME: Is this correct for all OS/PROC specific flags? */
+ elf_section_flags (osec) |= (elf_section_flags (isec)
+ & (SHF_MASKOS | SHF_MASKPROC));
/* Set things up for objcopy and relocatable link. The output
SHT_GROUP section will have its elf_next_in_group pointing back