From 1a6a0e9779c83d577376dce403cd931b79465dbe Mon Sep 17 00:00:00 2001 From: gingold Date: Wed, 7 Nov 2007 14:10:48 +0000 Subject: [PATCH] * config/tc-ppc.c (md_apply_fix): For PPC_TOC16 on XCOFF, uses offset within the TOC instead of the VMA. * gas/ppc/test1xcoff32.d: Updated to match RTOC bug fix. --- gas/ChangeLog | 5 +++++ gas/config/tc-ppc.c | 7 ++++--- gas/testsuite/ChangeLog | 4 ++++ gas/testsuite/gas/ppc/test1xcoff32.d | 14 +++++++------- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 2050971bf1..51c6fba6cc 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2007-11-07 Tristan Gingold + + * config/tc-ppc.c (md_apply_fix): For PPC_TOC16 on XCOFF, uses offset + within the TOC instead of the VMA. + 2007-11-06 Paul Brook * config/tc-arm.c (do_mull): Allow overlapping Rm for armv6. diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index 2a59847905..1679c7ecb1 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -6059,10 +6059,11 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) #ifdef TE_PE fixP->fx_addnumber = 0; #else - /* We want to use the offset within the data segment of the - symbol, not the actual VMA of the symbol. */ + /* We want to use the offset within the toc, not the actual VMA + of the symbol. */ fixP->fx_addnumber = - - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP->fx_addsy)); + - bfd_get_section_vma (stdoutput, S_GET_SEGMENT (fixP->fx_addsy)) + - S_GET_VALUE (ppc_toc_csect); #endif } #endif diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 44b608fc5b..d69e30c51a 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-11-07 Tristan Gingold + + * gas/ppc/test1xcoff32.d: Updated to match RTOC bug fix. + 2007-11-06 Paul Brook * gas/arm/mul-overlap.s: Add umull and smlal. diff --git a/gas/testsuite/gas/ppc/test1xcoff32.d b/gas/testsuite/gas/ppc/test1xcoff32.d index 7e7a7a7368..56de4d49db 100644 --- a/gas/testsuite/gas/ppc/test1xcoff32.d +++ b/gas/testsuite/gas/ppc/test1xcoff32.d @@ -76,17 +76,17 @@ Disassembly of section \.text: 24: 80 63 00 08 l r3,8\(r3\) 0+0028 : - 28: 80 62 00 0c l r3,12\(r2\) + 28: 80 62 00 00 l r3,0\(r2\) 2a: R_TOC ignored0\+0xf+ff8c - 2c: 80 62 00 10 l r3,16\(r2\) + 2c: 80 62 00 04 l r3,4\(r2\) 2e: R_TOC ignored1\+0xf+ff88 - 30: 80 62 00 14 l r3,20\(r2\) + 30: 80 62 00 08 l r3,8\(r2\) 32: R_TOC ignored2\+0xf+ff84 - 34: 80 62 00 18 l r3,24\(r2\) + 34: 80 62 00 0c l r3,12\(r2\) 36: R_TOC ignored3\+0xf+ff80 - 38: 80 62 00 1c l r3,28\(r2\) + 38: 80 62 00 10 l r3,16\(r2\) 3a: R_TOC ignored4\+0xf+ff7c - 3c: 80 62 00 20 l r3,32\(r2\) + 3c: 80 62 00 14 l r3,20\(r2\) 3e: R_TOC ignored5\+0xf+ff78 0+0040 : @@ -101,7 +101,7 @@ Disassembly of section \.text: 0+005c : 5c: 38 60 00 00 lil r3,0 60: 38 60 00 04 lil r3,4 - 64: 38 62 00 24 cal r3,36\(r2\) + 64: 38 62 00 18 cal r3,24\(r2\) 66: R_TOC ignored6\+0xf+ff74 Disassembly of section \.data: -- 2.11.0