https://sourceware.org/bugzilla/show_bug.cgi?id=3298

--- Comment #15 from Joern Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Quentin Boswank from comment #14)
> Created attachment 16105 [details]
> patch for gas bug zeroing 16 or 32 bit width jumptables when relaxing
> 
> Off course there was another one

+      max = (1 << (fixP->fx_size * 8)) - 1;

In C, 1 is of type int.  When fixP->fx_size is 4, this causes undefined
behaviour if int is 32 bit (on the host).

Also, I fear your replacing of apply_full_field_fix with md_number_to_chars
might
break something else - e.g. a constant with a label or symbol value used for a
pc-relative load.
Have you considered changing apply_full_field_fix instead to check for
SWITCH_TABLE (fixP) ?
i.e.:
  if ((fixP->fx_addsy != NULL || fixP->fx_pcrel)
      && !SWITCH_TABLE (fixP))

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to