diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-07-08 18:15:15 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-07-08 18:15:15 +0000 |
commit | 7f003b7fee63d112b8ce82c3b23c47d92c740195 (patch) | |
tree | 6178be6a341536907e413f6034a1aa4b96cd7c49 /gas/config | |
parent | ee7b308fe474ecfe5909961c7e894f1b6c2eb520 (diff) | |
download | gdb-7f003b7fee63d112b8ce82c3b23c47d92c740195.zip gdb-7f003b7fee63d112b8ce82c3b23c47d92c740195.tar.gz gdb-7f003b7fee63d112b8ce82c3b23c47d92c740195.tar.bz2 |
* config/tc-m68k.c (tc_gen_reloc): Change the code appropriately
if fx_pcrel is set. Correct setting the addend case in the
OBJ_ELF case (from Andreas Schwab
<schwab@issan.informatik.uni-dortmund.de>).
(md_show_usage): Correct -mfc5200 to -m5200.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-m68k.c | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/gas/config/tc-m68k.c b/gas/config/tc-m68k.c index e83bbb0..fcd9baf 100644 --- a/gas/config/tc-m68k.c +++ b/gas/config/tc-m68k.c @@ -762,7 +762,49 @@ tc_gen_reloc (section, fixp) abort (); if (fixp->fx_r_type != BFD_RELOC_NONE) - code = fixp->fx_r_type; + { + code = fixp->fx_r_type; + + /* Since DIFF_EXPR_OK is defined in tc-m68k.h, it is possible + that fixup_segment converted a non-PC relative reloc into a + PC relative reloc. In such a case, we need to convert the + reloc code. */ + if (fixp->fx_pcrel) + { + switch (code) + { + case BFD_RELOC_8: + code = BFD_RELOC_8_PCREL; + break; + case BFD_RELOC_16: + code = BFD_RELOC_16_PCREL; + break; + case BFD_RELOC_32: + code = BFD_RELOC_32_PCREL; + break; + case BFD_RELOC_8_PCREL: + case BFD_RELOC_16_PCREL: + case BFD_RELOC_32_PCREL: + case BFD_RELOC_8_GOT_PCREL: + case BFD_RELOC_16_GOT_PCREL: + case BFD_RELOC_32_GOT_PCREL: + case BFD_RELOC_8_GOTOFF: + case BFD_RELOC_16_GOTOFF: + case BFD_RELOC_32_GOTOFF: + case BFD_RELOC_8_PLT_PCREL: + case BFD_RELOC_16_PLT_PCREL: + case BFD_RELOC_32_PLT_PCREL: + case BFD_RELOC_8_PLTOFF: + case BFD_RELOC_16_PLTOFF: + case BFD_RELOC_32_PLTOFF: + break; + default: + as_bad_where (fixp->fx_file, fixp->fx_line, + "Cannot make %s relocation PC relative", + bfd_get_reloc_code_name (code)); + } + } + } else { #define F(SZ,PCREL) (((SZ) << 1) + (PCREL)) @@ -794,16 +836,12 @@ tc_gen_reloc (section, fixp) #else if (!fixp->fx_pcrel) reloc->addend = fixp->fx_addnumber; - else if ((fixp->fx_addsy->bsym->flags & BSF_SECTION_SYM) != 0) + else reloc->addend = (section->vma + (fixp->fx_pcrel_adjust == 64 ? -1 : fixp->fx_pcrel_adjust) + fixp->fx_addnumber + md_pcrel_from (fixp)); - else - reloc->addend = (fixp->fx_offset - + (fixp->fx_pcrel_adjust == 64 - ? -1 : fixp->fx_pcrel_adjust)); #endif reloc->howto = bfd_reloc_type_lookup (stdoutput, code); @@ -6361,7 +6399,7 @@ md_show_usage (stream) -l use 1 word for refs to undefined symbols [default 2]\n\ -m68000 | -m68008 | -m68010 | -m68020 | -m68030 | -m68040 | -m68060\n\ | -m68302 | -m68331 | -m68332 | -m68333 | -m68340 | -m68360\n\ - | -mcpu32 | -mcf5200\n\ + | -mcpu32 | -m5200\n\ specify variant of 680X0 architecture [default 68020]\n\ -m68881 | -m68882 | -mno-68881 | -mno-68882\n\ target has/lacks floating-point coprocessor\n\ |