From f381349953ca09f02ae26954a567be58747c3430 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Wed, 12 Jun 2002 16:04:39 +0000 Subject: [PATCH] Change text alignement to 4 bytes. --- bfd/ChangeLog | 11 +++++++++++ bfd/coff-rs6000.c | 7 +++---- bfd/coffcode.h | 10 ++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fd439709c0f..38f19f1230c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,14 @@ +2002-06-11 Tom Rix + + * coffcode.h (coff_compute_section_file_positions): Add data + section to AIX loader alignment check. + + * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section + alignment to 4 bytes. + (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment + power accessor macro. + (do_shared_object_padding): Remove invalid assertion. + 2002-06-10 Richard Sandiford * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index 7cd26b88ffd..a18aa5e9054 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -237,7 +237,7 @@ _bfd_xcoff_mkobject (abfd) xcoff_data (abfd)->debug_indices = NULL; /* text section alignment is different than the default */ - /* xcoff_data (abfd)->text_align_power = 5; */ + bfd_xcoff_text_align_power (abfd) = 2; return true; } @@ -278,8 +278,8 @@ _bfd_xcoff_copy_private_bfd_data (ibfd, obfd) else ox->snentry = sec->output_section->target_index; } - ox->text_align_power = ix->text_align_power; - ox->data_align_power = ix->data_align_power; + bfd_xcoff_text_align_power (obfd) = bfd_xcoff_text_align_power (ibfd); + bfd_xcoff_data_align_power (obfd) = bfd_xcoff_data_align_power (ibfd); ox->modtype = ix->modtype; ox->cputype = ix->cputype; ox->maxdata = ix->maxdata; @@ -1730,7 +1730,6 @@ do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size) int text_align_power; text_align_power = bfd_xcoff_text_align_power (in_bfd); - BFD_ASSERT (2 < text_align_power); pad = 1 << text_align_power; pad -= (*offset + ar_header_size) & (pad - 1); diff --git a/bfd/coffcode.h b/bfd/coffcode.h index ece19a2ecad..0363bb7b364 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -1782,8 +1782,8 @@ coff_mkobject_hook (abfd, filehdr, aouthdr) xcoff->toc = internal_a->o_toc; xcoff->sntoc = internal_a->o_sntoc; xcoff->snentry = internal_a->o_snentry; - xcoff->text_align_power = internal_a->o_algntext; - xcoff->data_align_power = internal_a->o_algndata; + bfd_xcoff_text_align_power (abfd) = internal_a->o_algntext; + bfd_xcoff_data_align_power (abfd) = internal_a->o_algndata; xcoff->modtype = internal_a->o_modtype; xcoff->cputype = internal_a->o_cputype; xcoff->maxdata = internal_a->o_maxdata; @@ -3084,8 +3084,10 @@ coff_compute_section_file_positions (abfd) AIX executable is stripped with gnu strip because the default vma of native is 0x10000150 but default for gnu is 0x10000140. Gnu stripped gnu excutable passes this check because the filepos is - 0x0140. */ - if (!strcmp (current->name, _TEXT)) + 0x0140. This problem also show up with 64 bit shared objects. The + data section must also be aligned. */ + if (!strcmp (current->name, _TEXT) + || !strcmp (current->name, _DATA)) { bfd_vma pad; bfd_vma align; -- 2.30.2