aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-06-16 09:56:29 +0930
committerAlan Modra <amodra@gmail.com>2014-06-16 12:26:38 +0930
commit4b1a927e92e49f333838f8f11e621608cccb3a03 (patch)
tree789d466a32bb13584a9809113e3079eb7380175a
parent44ed9ef26f62c4b348236c4dcea1de78d03900d9 (diff)
downloadgdb-4b1a927e92e49f333838f8f11e621608cccb3a03.zip
gdb-4b1a927e92e49f333838f8f11e621608cccb3a03.tar.gz
gdb-4b1a927e92e49f333838f8f11e621608cccb3a03.tar.bz2
Fix uninitialised ARM data
MALLOC_PERTURB_=1 results in "FAIL: PIC" on arm-vxworks, due to garbage in words with got relocs. * config/tc-arm.c (s_arm_elf_cons): Initialise after frag_more. (md_apply_fix): Delete now unnecessary zeroing for BFD_RELOC_ARM_GOT* and BFD_RELOC_ARM_TLS* relocs. Simplify BFD_RELOC_8 case.
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-arm.c12
2 files changed, 10 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 953130a3..383393b 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2014-06-16 Alan Modra <amodra@gmail.com>
+ * config/tc-arm.c (s_arm_elf_cons): Initialise after frag_more.
+ (md_apply_fix): Delete now unnecessary zeroing for BFD_RELOC_ARM_GOT*
+ and BFD_RELOC_ARM_TLS* relocs. Simplify BFD_RELOC_8 case.
+
+2014-06-16 Alan Modra <amodra@gmail.com>
+
* config/tc-cris.c (md_create_long_jump): Follow "short" jump
with a nop rather than leaving uninitialised.
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 590855c..fc86db4 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -3453,7 +3453,8 @@ s_arm_elf_cons (int nbytes)
memcpy (base, save_buf, p - base);
offset = nbytes - size;
- p = frag_more ((int) nbytes);
+ p = frag_more (nbytes);
+ memset (p, 0, nbytes);
fix_new_exp (frag_now, p - frag_now->fr_literal + offset,
size, &exp, 0, (enum bfd_reloc_code_real) reloc);
}
@@ -22384,7 +22385,7 @@ md_apply_fix (fixS * fixP,
case BFD_RELOC_8:
if (fixP->fx_done || !seg->use_rela_p)
- md_number_to_chars (buf, value, 1);
+ *buf = value;
break;
case BFD_RELOC_16:
@@ -22397,9 +22398,6 @@ md_apply_fix (fixS * fixP,
case BFD_RELOC_ARM_THM_TLS_CALL:
case BFD_RELOC_ARM_TLS_DESCSEQ:
case BFD_RELOC_ARM_THM_TLS_DESCSEQ:
- S_SET_THREAD_LOCAL (fixP->fx_addsy);
- break;
-
case BFD_RELOC_ARM_TLS_GOTDESC:
case BFD_RELOC_ARM_TLS_GD32:
case BFD_RELOC_ARM_TLS_LE32:
@@ -22407,12 +22405,10 @@ md_apply_fix (fixS * fixP,
case BFD_RELOC_ARM_TLS_LDM32:
case BFD_RELOC_ARM_TLS_LDO32:
S_SET_THREAD_LOCAL (fixP->fx_addsy);
- /* fall through */
+ break;
case BFD_RELOC_ARM_GOT32:
case BFD_RELOC_ARM_GOTOFF:
- if (fixP->fx_done || !seg->use_rela_p)
- md_number_to_chars (buf, 0, 4);
break;
case BFD_RELOC_ARM_GOT_PREL: