aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
authorTom Rix <trix@redhat.com>2001-12-20 21:29:21 +0000
committerTom Rix <trix@redhat.com>2001-12-20 21:29:21 +0000
commit47ede03a416b9633130623411cc35688461febdd (patch)
tree31b29ba0f319d28fb85bc6dc8dc0ee44db0a7696 /bfd/coffcode.h
parentc3d3ce5b899ed50f90638541669be99930216730 (diff)
downloadgdb-47ede03a416b9633130623411cc35688461febdd.zip
gdb-47ede03a416b9633130623411cc35688461febdd.tar.gz
gdb-47ede03a416b9633130623411cc35688461febdd.tar.bz2
Special handling of AIX xcoff text alignment fix.
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index d759115..b5bd442 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -3054,7 +3054,36 @@ coff_compute_section_file_positions (abfd)
padding the previous section up if necessary */
old_sofar = sofar;
- sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
+#ifdef RS6000COFF_C
+ /* AIX loader checks the text section alignment of (vma - filepos)
+ So even though the filepos may be aligned wrt the o_algntext, for
+ AIX executables, this check fails. This shows up when an native
+ 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))
+ {
+ bfd_vma pad;
+ bfd_vma align;
+
+ sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
+
+ align = 1 << current->alignment_power;
+ pad = abs (current->vma - sofar) % align;
+
+ if (pad)
+ {
+ pad = align - pad;
+ sofar += pad;
+ }
+ }
+ else
+#else
+ {
+ sofar = BFD_ALIGN (sofar, 1 << current->alignment_power);
+ }
+#endif
if (previous != (asection *) NULL)
{
previous->_raw_size += sofar - old_sofar;