aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-04-09 03:09:12 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-04-09 03:09:12 +0000
commit9214dd3be3f17bb29966e6fdd563bb9c0171eb58 (patch)
tree459f3f565e0f2265c1bbea43681356f2bb18212a /gas
parenteb0a7d52bdc92918fd9c83f20f31b87c3abad137 (diff)
downloadgdb-9214dd3be3f17bb29966e6fdd563bb9c0171eb58.zip
gdb-9214dd3be3f17bb29966e6fdd563bb9c0171eb58.tar.gz
gdb-9214dd3be3f17bb29966e6fdd563bb9c0171eb58.tar.bz2
* config/tc-mips.c (macro): Add comments explaining the rationale
for Chris' change.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c18
2 files changed, 22 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index dd82150..9c32d9d 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2003-04-09 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/tc-mips.c (macro): Add comments explaining the rationale
+ for Chris' change.
+
2003-04-09 Chris Demetriou <cgd@broadcom.com>
* config/tc-mips.c (macro): Put back `+ 0x8000' in test for 64-bit
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 7fa0251..3204ce9 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -5846,7 +5846,23 @@ macro (ip)
range is shifted down by 32768 here. This code should
probably attempt to generate 64-bit constants more
efficiently in general.
- */
+
+ As an extension for architectures with 64-bit registers,
+ we don't truncate 64-bit addresses given as literal
+ constants down to 32 bits, to support existing practice
+ in the mips64 Linux (the kernel), that compiles source
+ files with -mabi=64, assembling them as o32 or n32 (with
+ -Wa,-32 or -Wa,-n32). This is not beautiful, but since
+ the whole kernel is loaded into a memory region that is
+ addressible with sign-extended 32-bit addresses, it is
+ wasteful to compute the upper 32 bits of every
+ non-literal address, that takes more space and time.
+ Some day this should probably be implemented as an
+ assembler option, such that the kernel doesn't have to
+ use such ugly hacks, even though it will still have to
+ end up converting the binary to ELF32 for a number of
+ platforms whose boot loaders don't support ELF64
+ binaries. */
if ((offset_expr.X_op != O_constant && HAVE_64BIT_ADDRESSES)
|| (offset_expr.X_op == O_constant
&& !IS_SEXT_32BIT_NUM (offset_expr.X_add_number + 0x8000)