{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGCALL6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR},
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 4, NDS32_INSN16 , BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 4, NDS32_INSN16 , BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_PTR},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_ABS, BFD_RELOC_NDS32_EMPTY},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, 0, BFD_RELOC_NDS32_17_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_17_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{2, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 2, 0, BFD_RELOC_NDS32_9_PCREL},
+ {0, 2, NDS32_PCREL, BFD_RELOC_NDS32_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
- {0, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP5},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{4, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_15_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP6},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP7},
- {4, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_WORD_9_PCREL},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_WORD_9_PCREL},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{8, 4, 0, BFD_RELOC_NDS32_LO12S0_ORI},
{12, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16},
{4, 4, 4, 4, 4}, /* relax_branch_isize */
{
{
- {0, 4, 0, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {0, 4, NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S256 */
{
{0, 4, NDS32_INSN16 | NDS32_HINT, BFD_RELOC_NDS32_INSN16},
{0, 4, NDS32_PTR | NDS32_HINT, BFD_RELOC_NDS32_LONGJUMP7},
- {4, 4, 0, BFD_RELOC_NDS32_15_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_15_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_WORD_9_PCREL},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S64K */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_WORD_9_PCREL},
- {4, 4, 0, BFD_RELOC_NDS32_25_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {4, 4, NDS32_PCREL, BFD_RELOC_NDS32_25_PCREL},
{0, 0, 0, 0}
}, /* BR_RANGE_S16M */
{
- {0, 4, NDS32_CREATE_LABEL, BFD_RELOC_NDS32_WORD_9_PCREL},
+ {0, 4, NDS32_CREATE_LABEL | NDS32_PCREL, BFD_RELOC_NDS32_WORD_9_PCREL},
{4, 4, 0, BFD_RELOC_NDS32_HI20},
{8, 4, 0, BFD_RELOC_NDS32_LO12S0_ORI},
{12, 4, NDS32_INSN16, BFD_RELOC_NDS32_INSN16},
static int
builtin_isreg (const char *s, const char *x ATTRIBUTE_UNUSED)
{
- return s[0] == '$';
+ if (s [0] == '$' && hash_find (nds32_gprs_hash, (s + 1)))
+ return 1;
+ return 0;
}
static int
{
expressionS exp;
- parse_expression (argv[1], &exp);
-
if (builtin_isreg (argv[1], NULL))
do_pseudo_move_reg_internal (argv[0], argv[1]);
- else if (exp.X_op == O_constant)
- /* move $rt, imm -> li $rt, imm */
- do_pseudo_li_internal (argv[0], exp.X_add_number);
else
- /* l.w $rt, var -> l.w $rt, var */
- do_pseudo_ls_bhw (argc, argv, 2);
+ {
+ parse_expression (argv[1], &exp);
+ if (exp.X_op == O_constant)
+ /* move $rt, imm -> li $rt, imm */
+ do_pseudo_li_internal (argv[0], exp.X_add_number);
+ else
+ /* l.w $rt, var -> l.w $rt, var */
+ do_pseudo_ls_bhw (argc, argv, 2);
+ }
}
static void
{
if (subseg_text_p (now_seg))
{
+ dwarf2_emit_insn (0);
fragP = frag_now;
frag_align_code (n, max);
unsigned int ptr_offset, hint_count, relax_code_size, count = 0;
uint32_t *code_seq, code_insn;
char *where;
+ int pcrel;
if (!relocs_pattern)
return;
{
/* Set the real instruction size in element. */
fixup_size = pattern_now->opcode->isize;
+ pcrel = ((fixup_now->ramp & NDS32_PCREL) != 0) ? 1 : 0;
if (fixup_now->ramp & NDS32_FIX)
{
/* Convert original relocation. */
if (fixup_size != 0)
{
- fixP = fix_new_exp (fragP, where - fragP->fr_literal,
- fixup_size, &exp, 0, fixup_now->r_type);
+ fixP = fix_new_exp (fragP, where - fragP->fr_literal, fixup_size,
+ &exp, pcrel, fixup_now->r_type);
fixP->fx_addnumber = fixP->fx_offset;
}
fixup_now++;
label_exist = 0;
insn.info = (expressionS *) alloca (sizeof (expressionS));
+ asm_desc.result = NASM_OK;
nds32_assemble (&asm_desc, &insn, str);
switch (asm_desc.result)
as_bad (_("Incorrect syntax, %s."), str);
return;
case NASM_ERR_OPERAND:
- as_bad (_("Unrecognized operand, %s."), str);
+ as_bad (_("Unrecognized operand/register, %s."), str);
return;
case NASM_ERR_OUT_OF_RANGE:
as_bad (_("Operand out of range, %s."), str);
return;
/* md_convert_frag will insert relocations. */
}
- else if (!fld && !relaxing && enable_16bit && (optimize || optimize_for_space)
- && ((!verbatim && insn.opcode->isize == 4
+ else if (!relaxing && enable_16bit && (optimize || optimize_for_space)
+ && ((!fld && !verbatim && insn.opcode->isize == 4
&& nds32_convert_32_to_16 (stdoutput, insn.insn, &insn_16, NULL))
|| (insn.opcode->isize == 2
&& nds32_convert_16_to_32 (stdoutput, insn.insn, NULL))))
{
/* Record this one is relaxable. */
+ pexp = insn.info;
dwarf2_emit_insn (0);
- out = frag_var (rs_machine_dependent,
- 4, /* Max size is 32-bit instruction. */
- 0, /* VAR is un-used. */
- 0, NULL, 0, NULL);
+ if (fld)
+ {
+ out = frag_var (rs_machine_dependent,
+ 4, /* Max size is 32-bit instruction. */
+ 0, /* VAR is un-used. */
+ 0, pexp->X_add_symbol, pexp->X_add_number, 0);
+ fragP->tc_frag_data.flag |= NDS32_FRAG_RELAXABLE_BRANCH;
+ }
+ else
+ out = frag_var (rs_machine_dependent,
+ 4, /* Max size is 32-bit instruction. */
+ 0, /* VAR is un-used. */
+ 0, NULL, 0, NULL);
fragP->tc_frag_data.flag |= NDS32_FRAG_RELAXABLE;
fragP->tc_frag_data.opcode = insn.opcode;
fragP->tc_frag_data.insn = insn.insn;
exp.X_op = O_symbol;
exp.X_add_symbol = abs_section_sym;
exp.X_add_number = 0;
- fixP = fix_new_exp (fragP, 0, 0, &exp, 0, BFD_RELOC_NDS32_LABEL);
+ fixP = fix_new_exp (fragP, fragP->fr_fix - 4, 0, &exp,
+ 0, BFD_RELOC_NDS32_LABEL);
+ if (!verbatim)
+ fragP->tc_frag_data.flag = NDS32_FRAG_ALIGN;
}
}
else
}
frag_t = frag_t->fr_next;
}
+
+ if (fragP->tc_frag_data.flag & NDS32_FRAG_ALIGN)
+ {
+ address = fragP->fr_address;
+ addressT offset = nds32_get_align (address, 2);
+ if (offset & 0x2)
+ {
+ /* If there is label on the prev_frag, check if it is aligned. */
+ if (!((*prev_frag)->tc_frag_data.flag & NDS32_FRAG_LABEL)
+ || (((*prev_frag)->fr_address + (*prev_frag)->fr_fix - 2 )
+ & 0x2) == 0)
+ nds32_adjust_relaxable_frag (*prev_frag, fragP);
+ }
+ *prev_frag = NULL;
+ return;
+ }
}
/* md_relax_frag */
enum nds32_br_range branch_range_type = fragP->fr_subtype;
struct nds32_opcode *opcode = fragP->tc_frag_data.opcode;
uint32_t origin_insn = fragP->tc_frag_data.insn;
- int backup_endian;
relax_info_t *relax_info;
char *fr_buffer;
int fr_where;
uint32_t *code_seq;
uint32_t insn;
int code_size, insn_size, offset, fixup_size;
- int buf_offset;
+ int buf_offset, pcrel;
int i, k;
uint16_t insn_16;
nds32_relax_fixup_info_t fixup_info[MAX_RELAX_FIX];
if (opcode == NULL)
return;
- /* Relax the insntruction. */
- if (fragP->tc_frag_data.flag & NDS32_FRAG_RELAXED)
+ if (fragP->tc_frag_data.flag & NDS32_FRAG_RELAXABLE_BRANCH)
+ {
+ relax_info = hash_find (nds32_relax_info_hash, opcode->opcode);
+
+ if (relax_info == NULL)
+ return;
+
+ i = BR_RANGE_S256;
+ while (i < BR_RANGE_NUM
+ && relax_info->relax_code_size[i]
+ != (fragP->tc_frag_data.flag & NDS32_FRAG_RELAXED ? 4 : 2))
+ i++;
+
+ if (i >= BR_RANGE_NUM)
+ as_bad ("Internal error: Cannot find relocation of"
+ "relaxable branch.");
+
+ exp.X_op = O_symbol;
+ exp.X_add_symbol = branch_symbol;
+ exp.X_add_number = branch_offset;
+ pcrel = ((relax_info->relax_fixup[i][0].ramp & NDS32_PCREL) != 0) ? 1 : 0;
+ fr_where = fragP->fr_fix - 2;
+ fixP = fix_new_exp (fragP, fr_where, relax_info->relax_fixup[i][0].size,
+ &exp, pcrel, relax_info->relax_fixup[i][0].r_type);
+ fixP->fx_addnumber = fixP->fx_offset;
+
+ if (fragP->tc_frag_data.flag & NDS32_FRAG_RELAXED)
+ {
+ insn_16 = fragP->tc_frag_data.insn;
+ nds32_convert_16_to_32 (stdoutput, insn_16, &insn);
+ fr_buffer = fragP->fr_literal + fr_where;
+ fragP->fr_fix += 2;
+ exp.X_op = O_symbol;
+ exp.X_add_symbol = abs_section_sym;
+ exp.X_add_number = 0;
+ fix_new_exp (fragP, fr_where, 4,
+ &exp, 0, BFD_RELOC_NDS32_INSN16);
+ number_to_chars_bigendian (fr_buffer, insn, 4);
+ }
+ }
+ else if (fragP->tc_frag_data.flag & NDS32_FRAG_RELAXED)
{
- expressionS exp_t;
if (fragP->tc_frag_data.opcode->isize == 2)
{
insn_16 = fragP->tc_frag_data.insn;
fragP->fr_fix += 2;
fr_where = fragP->fr_fix - 4;
fr_buffer = fragP->fr_literal + fr_where;
- exp_t.X_op = O_symbol;
- exp_t.X_add_symbol = abs_section_sym;
- exp_t.X_add_number = 0;
- fix_new_exp (fragP, fr_where, 4, &exp_t, 0,
+ exp.X_op = O_symbol;
+ exp.X_add_symbol = abs_section_sym;
+ exp.X_add_number = 0;
+ fix_new_exp (fragP, fr_where, 4, &exp, 0,
BFD_RELOC_NDS32_INSN16);
number_to_chars_bigendian (fr_buffer, insn, 4);
}
- else
+ else if (fragP->tc_frag_data.flag & NDS32_FRAG_BRANCH)
{
/* Branch instruction adjust and append relocations. */
relax_info = hash_find (nds32_relax_info_hash, opcode->opcode);
if (relax_info == NULL)
return;
- backup_endian = target_big_endian;
- target_big_endian = 1;
-
fr_where = fragP->fr_fix - opcode->isize;
fr_buffer = fragP->fr_literal + fr_where;
&& relax_info->relax_fixup[branch_range_type][k].offset < offset)
k++;
- md_number_to_chars (fr_buffer + buf_offset, insn, insn_size);
+ number_to_chars_bigendian (fr_buffer + buf_offset, insn, insn_size);
buf_offset += insn_size;
offset += insn_size;
for (i = 0; fixup_info[i].size != 0; i++)
{
fixup_size = fixup_info[i].size;
+ pcrel = ((fixup_info[i].ramp & NDS32_PCREL) != 0) ? 1 : 0;
if ((fixup_info[i].ramp & NDS32_CREATE_LABEL) != 0)
{
if (fixup_info[i].r_type != 0)
{
fixP = fix_new_exp (fragP, fr_where + fixup_info[i].offset,
- fixup_size, &exp, 0, fixup_info[i].r_type);
+ fixup_size, &exp, pcrel,
+ fixup_info[i].r_type);
fixP->fx_addnumber = fixP->fx_offset;
}
}
fragP->fr_fix = fr_where + buf_offset;
-
- target_big_endian = backup_endian;
}
}
hash_traverse (nds32_hint_hash, nds32_elf_append_relax_relocs);
}
+static void
+nds32_elf_insert_final_frag (void)
+{
+ struct frchain *frchainP;
+ asection *s;
+ fragS *fragP;
+
+ if (!optimize)
+ return;
+
+ for (s = stdoutput->sections; s; s = s->next)
+ {
+ segment_info_type *seginfo = seg_info (s);
+ if (!seginfo)
+ continue;
+
+ for (frchainP = seginfo->frchainP; frchainP != NULL;
+ frchainP = frchainP->frch_next)
+ {
+ subseg_set (s, frchainP->frch_subseg);
+
+ if (subseg_text_p (now_seg))
+ {
+ fragP = frag_now;
+ frag_var (rs_machine_dependent, 2, /* Max size. */
+ 0, /* VAR is un-used. */ 0, NULL, 0, NULL);
+ fragP->tc_frag_data.flag |= NDS32_FRAG_FINAL;
+ }
+ }
+ }
+}
+
void
md_end (void)
{
+ nds32_elf_insert_final_frag ();
nds32_elf_analysis_relax_hint ();
bfd_map_over_sections (stdoutput, nds32_insert_leb128_fixes, NULL);
}