MIPS16/GAS: Factor out duplicate symbol value conversion code
authorMaciej W. Rozycki <macro@imgtec.com>
Thu, 27 Apr 2017 01:25:33 +0000 (02:25 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Thu, 27 Apr 2017 11:21:58 +0000 (12:21 +0100)
commit14f72d45a22f25f6d00a62fc03bcf9827df226f5
tree561b79a3f4578607eef38ad6eaef63757fad9e2e
parent1425c41dcd68350d9be9670910c547cc7ab91e0e
MIPS16/GAS: Factor out duplicate symbol value conversion code

Factor out and consolidate duplicate section-relative to PC-relative
symbol value conversion in `mips16_extended_frag' and `md_convert_frag'
used for MIPS16 relaxation, observing that the final calculation in the
latter function implies `stretch == 0'.  Sanitize the formatting of code
moved.

gas/
* config/tc-mips.c (mips16_pcrel_val): New function, factored
out from...
(mips16_extended_frag): ... here.
(md_convert_frag): Use `mips16_pcrel_val' rather than repeated
code in MIPS16 relaxation, with `stretch' hardcoded to 0.
gas/ChangeLog
gas/config/tc-mips.c