On Sun, Sep 4, 2022 at 12:00 AM Lulu Cheng <chengl...@loongson.cn> wrote:
>
>
> 在 2022/9/4 下午2:35, Xi Ruoyao 写道:
> > On Sun, 2022-09-04 at 11:22 +0800, Lulu Cheng wrote:
> >> 在 2022/9/4 上午10:51, Xi Ruoyao 写道:
> >>
> >>> On Sun, 2022-09-04 at 10:26 +0800, Lulu Cheng wrote:
> >>>
> >>>> If the above modifications are not added, the function call is:
> >>>>
> >>>>   bl %plt(test1)
> >>>>
> >>>> now is :
> >>>>
> >>>>   bl test1
> >>> Regarding "%plt(...)", in the binutils code:
> >>>
> >>>     /* For compatible old asm code.  */
> >>>     if (0 == strcmp (op_c_str, "plt"))
> >>>       btype = BFD_RELOC_LARCH_B26;
> >>>
> >>> Link:
> >>> https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gas/config/loongarch-parse.y;h=8704687706df50aa15aff05f97e4560d7ec6fa23;hb=refs/heads/master#l131
> >>>
> >>> Zhensong: does "old asm code" here mean we should remove %plt from
> >>> "new"
> >>> assembly code, i. e. stop to print %plt(...) in GCC completely?
> >>>
> >>
> >> I think '%plt' also needs to be removed from the readability of the
> >> assembly code.:-\
> > I understand, but maybe we should remove %plt unconditionally, with or
> > without -mdirect-extern-access.  Note that for -mcmodel=medium we don't
> > say something like "%pc_hi20(%plt(x))" either.
>
>
> I have thought about this problem. For example, there is no '%plt' in
> aarch64, but I think it can be added and easily distinguished at the
> assembly code level,
>
> so this is not removed.

I think @plt should be removed unconditionally. It was a mistake in
some ABI (e.g. i386, riscv).

Reply via email to