aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2003-10-16 21:04:04 +0000
committerH.J. Lu <hjl.tools@gmail.com>2003-10-16 21:04:04 +0000
commit9da84788daafe295573bb29bb85616086abc0c2c (patch)
treece1e5f3ac6a9e2c42f1207d1648a7b1ffeb6980a /bfd
parent506fb3678493f7f3028e1364dfcf7b8b8f2ed4d8 (diff)
downloadgdb-9da84788daafe295573bb29bb85616086abc0c2c.zip
gdb-9da84788daafe295573bb29bb85616086abc0c2c.tar.gz
gdb-9da84788daafe295573bb29bb85616086abc0c2c.tar.bz2
2003-10-16 H.J. Lu <hongjiu.lu@intel.com>
* elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't use the last CIE from a different section. (_bfd_elf_write_section_eh_frame): Don't pad beyond the raw size of the output section.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/elf-eh-frame.c9
2 files changed, 15 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b96d322..337c7c8 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,10 @@
+2003-10-16 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't
+ use the last CIE from a different section.
+ (_bfd_elf_write_section_eh_frame): Don't pad beyond the raw
+ size of the output section.
+
2003-10-07 Roland McGrath <roland@redhat.com>
* elf.c (_bfd_elf_make_section_from_phdr): Set alignment_power of
diff --git a/bfd/elf-eh-frame.c b/bfd/elf-eh-frame.c
index c2f6b96..28e0b55 100644
--- a/bfd/elf-eh-frame.c
+++ b/bfd/elf-eh-frame.c
@@ -372,6 +372,9 @@ _bfd_elf_discard_section_eh_frame
all FDEs. Also, it can be removed if we have removed
all FDEs using it. */
if ((!info->relocatable
+ && hdr_info->last_cie_sec
+ && (sec->output_section
+ == hdr_info->last_cie_sec->output_section)
&& cie_compare (&cie, &hdr_info->last_cie) == 0)
|| cie_usage_count == 0)
{
@@ -1031,7 +1034,11 @@ _bfd_elf_write_section_eh_frame (bfd *abfd,
unsigned int alignment = 1 << sec->alignment_power;
unsigned int pad = sec->_cooked_size % alignment;
- if (pad)
+ /* Don't pad beyond the raw size of the output section. It
+ can happen at the last input section. */
+ if (pad
+ && ((sec->output_offset + sec->_cooked_size + pad)
+ <= sec->output_section->_raw_size))
{
/* Find the last CIE/FDE. */
for (i = sec_info->count - 1; i > 0; i--)