Bug 24505 - Should --nmagic affect MAXPAGESIZE/COMMONPAGESIZE?
Summary: Should --nmagic affect MAXPAGESIZE/COMMONPAGESIZE?
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-30 15:59 UTC by Fangrui Song
Modified: 2019-04-30 15:59 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2019-04-30 15:59:44 UTC
-n/--nmagic disables page alignment of sections. Should it affect the target specific constants MAXPAGESIZE and COMMONPAGESIZE by changing them to 1?

% cat a.lds
maxpagesize = CONSTANT(MAXPAGESIZE);
commonpagesize = CONSTANT(COMMONPAGESIZE);
% as /dev/null -o a.o
% ld.bfd -n a.o -T a.lds -o a
% readelf -Ws a | grep pagesize
     2: 0000000000001000     0 NOTYPE  GLOBAL DEFAULT  ABS commonpagesize
     3: 0000000000200000     0 NOTYPE  GLOBAL DEFAULT  ABS maxpagesize

Feel free to close the issue if CONSTANT(MAXPAGESIZE) / CONSTANT(COMMONPAGESIZE) are not supposed to change.
I just have a feeling that making commonpagesize=maxpagesize=1 may simplify the implementation.