On Tue, Jul 11, 2023 at 11:36 AM Florian Weimer via Gcc <gcc@gcc.gnu.org> wrote:
>
> How does the Coldfire m68k subtarget and sure that displacements in PIC
> code are within the addressable range?

There is usually a branch shortening pass relying on correct
instruction lengths.

I suggest to file a bugreport with preprocessed sources as testcase.

Richard.

> We have a source file in glibc that fails at assembly because it
> contains a branch that is out of range with -fpic.  The GAS error is:
>
> …/iso-2022-jp.s: Fatal error: Tried to convert PC relative branch to absolute 
> jump
>
> (Not sure if this is actually a branch, the diagnostic isn't really
> helpful.)
>
> The -fPIC option does not help, and -fpic -mpcrel ICEs at the end of
> m68k.cc:sched_attr_op_type.  The op variable at this point is:
>
> (mem/u:HI (const:SI (plus:SI (symbol_ref:SI ("__jisx0212_to_ucs_idx") [flags 
> 0x40] <var_decl 0x7ffff761df30 __jisx0212_to_ucs_idx>)
>             (const_int 2 [0x2]))) [2 MEM[(const struct jisx0212_idx 
> *)&__jisx0212_to_ucs_idx].end
>
> The iso-2022-jp.c source file has some large data tables, so it's
> probably not surprising that -fpic doesn't work.
>
> Thanks,
> Florian
>

Reply via email to