bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/30907] ELF segment add extra 2 LOAD segments in aarch64, making


From: i at maskray dot me
Subject: [Bug ld/30907] ELF segment add extra 2 LOAD segments in aarch64, making binary bigger 128KiB than before
Date: Sun, 08 Oct 2023 17:53:16 +0000

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

Fangrui Song <i at maskray dot me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i at maskray dot me

--- Comment #4 from Fangrui Song <i at maskray dot me> ---
Perhaps GNU ld can split `-z separate-code` into two options `--rosegment` and
`-z separate-code`?
I have some description at
https://maskray.me/blog/2020-11-15-explain-gnu-linker-options#no-rosegment

> Separating data and code is a best practice.

Therefore lld defaults to --rosegment while it defauls to `-z noseparate-code`
to avoid waste.
File content at the boundary of R/RX can be double mapped, which technically
can be used to find ROP gadgets.
However, decreasing ROP gadgets there is pretty much a secure theatre.
https://isopenbsdsecu.re/mitigations/rop_removal/ is somewhat related.

> But I wonder that why the alignment is not the kernel PAGESIZE(I set 
> PAGE_SIZE to 4096 when compiling, but the alignment is still 65535)? 

The protocol between the linke and the kernel is that a linked object file may
run on systems with different page sizes.
All page sizes not larger than MAXPAGESIZE (link-time decision) are supported.
The model in practice does not build a different object file for each page
size.

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]