It may still be better to add it to match the style.  On i386, also.

It is quite surprising compiler behaviour to create a PLT for such .rodata..

Alexander Bluhm <alexander.bl...@gmx.net> wrote:

> On Thu, Apr 20, 2023 at 05:21:37PM -0600, Theo de Raadt wrote:
> > I wonder if the same happens on arm64.
> 
> On amd64 with the strange behavior linking gapdummy.o to gap.o adds
> a .plt.
> 
> root@ot32:.../obj# objdump -s gapdummy.o  | grep 'Contents of section'
> Contents of section .note.gnu.property:
> root@ot32:.../obj# objdump -s gap.o  | grep 'Contents of section'
> Contents of section .text:
> Contents of section .rodata:
> Contents of section .data:
> Contents of section .plt:
> Contents of section .note.gnu.property:
> 
> On arm64 we get the .note.gnu.property, but no .plt.  No .plt in
> bsd.
> 
> root@ot11:.../obj# objdump -s gapdummy.o  | grep 'Contents of section'
> Contents of section .note.gnu.property:
> Contents of section .comment:
> root@ot11:.../obj# objdump -s gap.o  | grep 'Contents of section'
> Contents of section .text:
> Contents of section .rodata:
> Contents of section .data:
> Contents of section .comment:
> Contents of section .note.gnu.property:
> 
> With my fix (compiling -fcf-protection=none gapdummy.c) on amd64
> neither .note.gnu.property nor .plt is added.
> 
> bluhm@t430s:.../obj$ objdump -s gapdummy.o  | grep 'Contents of section'
> bluhm@t430s:.../obj$ objdump -s gap.o  | grep 'Contents of section'
> Contents of section .text:
> Contents of section .rodata:
> Contents of section .data:
> 
> Don't know if we want to change anything on arm64.
> 
> bluhm

Reply via email to