From 1f1b5e506bf0d9bffef8525eb9bee19646713eb6 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 11 Oct 2024 08:19:34 +0200 Subject: bfd/ELF: restrict file alignment for object files While for executables properly aligning sections within the file can be quite relevant, the same is of pretty little importance for relocatable object files. Avoid passing "true" into _bfd_elf_assign_file_position_for_section() when dealing with object files, but compensate minimally by applying log_file_align in such cases as a cap to the alignment put in place. --- gas/testsuite/gas/aarch64/tail_padding.d | 6 +++--- gas/testsuite/gas/arm/ehabi-pacbti-m.d | 2 +- gas/testsuite/gas/ia64/group-1.d | 10 +++++----- gas/testsuite/gas/ia64/group-2.d | 14 +++++++------- gas/testsuite/gas/mmix/bspec-2.d | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'gas') diff --git a/gas/testsuite/gas/aarch64/tail_padding.d b/gas/testsuite/gas/aarch64/tail_padding.d index acb4ff2..12f2f6f 100644 --- a/gas/testsuite/gas/aarch64/tail_padding.d +++ b/gas/testsuite/gas/aarch64/tail_padding.d @@ -11,10 +11,10 @@ Section Headers: Size EntSize Flags Link Info Align \[ 0\] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 - \[ 1\] \.text PROGBITS 0000000000000000 00000040 + \[ 1\] \.text PROGBITS 0000000000000000 000000.. 0000000000000000 0000000000000000 AX 0 0 1 - \[ 2\] \.data PROGBITS 0000000000000000 00000040 + \[ 2\] \.data PROGBITS 0000000000000000 000000.. 0000000000000008 0000000000000000 WA 0 0 64 - \[ 3\] \.bss NOBITS 0000000000000000 00000080 + \[ 3\] \.bss NOBITS 0000000000000000 000000.. 000000000000000c 0000000000000000 WA 0 0 64 #... diff --git a/gas/testsuite/gas/arm/ehabi-pacbti-m.d b/gas/testsuite/gas/arm/ehabi-pacbti-m.d index 1b13020..dca7abd 100644 --- a/gas/testsuite/gas/arm/ehabi-pacbti-m.d +++ b/gas/testsuite/gas/arm/ehabi-pacbti-m.d @@ -4,7 +4,7 @@ #readelf: -u #target: [is_elf_format] -Unwind section '.ARM.exidx' at offset 0x5c contains 1 entry: +Unwind section '.ARM.exidx' at offset 0x[0-9a-f]+ contains 1 entry: 0x0: @0x0 Compact model index: 1 diff --git a/gas/testsuite/gas/ia64/group-1.d b/gas/testsuite/gas/ia64/group-1.d index a04a5cc..5c712ab 100644 --- a/gas/testsuite/gas/ia64/group-1.d +++ b/gas/testsuite/gas/ia64/group-1.d @@ -8,15 +8,15 @@ Section Headers: Size EntSize Flags Link Info Align \[ 0\] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 - \[ 1\] \.group GROUP 0000000000000000 00000040 + \[ 1\] \.group GROUP 0000000000000000 [0-9a-f]+ 0000000000000008 0000000000000004 6 6 4 - \[ 2\] \.text PROGBITS 0000000000000000 00000050 + \[ 2\] \.text PROGBITS 0000000000000000 [0-9a-f]+ 0000000000000000 0000000000000000 AX 0 0 16 - \[ 3\] \.data PROGBITS 0000000000000000 00000050 + \[ 3\] \.data PROGBITS 0000000000000000 [0-9a-f]+ 0000000000000000 0000000000000000 WA 0 0 1 - \[ 4\] \.bss NOBITS 0000000000000000 00000050 + \[ 4\] \.bss NOBITS 0000000000000000 [0-9a-f]+ 0000000000000000 0000000000000000 WA 0 0 1 - \[ 5\] \.text PROGBITS 0000000000000000 00000050 + \[ 5\] \.text PROGBITS 0000000000000000 [0-9a-f]+ 0000000000000010 0000000000000000 AXG 0 0 16 \[ 6\] \.symtab SYMTAB 0000000000000000 .* 00000000000000c0 0000000000000018 7 8 8 diff --git a/gas/testsuite/gas/ia64/group-2.d b/gas/testsuite/gas/ia64/group-2.d index 52a313a..91473df 100644 --- a/gas/testsuite/gas/ia64/group-2.d +++ b/gas/testsuite/gas/ia64/group-2.d @@ -9,19 +9,19 @@ Section Headers: Size EntSize Flags Link Info Align \[ 0\] NULL 0000000000000000 00000000 0000000000000000 0000000000000000 0 0 0 - \[ 1\] \.group GROUP 0000000000000000 00000040 + \[ 1\] \.group GROUP 0000000000000000 [0-9a-f]+ 0000000000000014 0000000000000004 9 5 4 - \[ 2\] \.text PROGBITS 0000000000000000 00000060 + \[ 2\] \.text PROGBITS 0000000000000000 [0-9a-f]+ 0000000000000000 0000000000000000 AX 0 0 16 - \[ 3\] \.data PROGBITS 0000000000000000 00000060 + \[ 3\] \.data PROGBITS 0000000000000000 [0-9a-f]+ 0000000000000000 0000000000000000 WA 0 0 1 - \[ 4\] \.bss NOBITS 0000000000000000 00000060 + \[ 4\] \.bss NOBITS 0000000000000000 [0-9a-f]+ 0000000000000000 0000000000000000 WA 0 0 1 - \[ 5\] \.gnu\.linkonce\.t\.f PROGBITS 0000000000000000 00000060 + \[ 5\] \.gnu\.linkonce\.t\.f PROGBITS 0000000000000000 [0-9a-f]+ 0000000000000000 0000000000000000 AXG 0 0 16 - \[ 6\] \.gnu\.linkonce\.ia6 PROGBITS 0000000000000000 00000060 + \[ 6\] \.gnu\.linkonce\.ia6 PROGBITS 0000000000000000 [0-9a-f]+ 0000000000000010 0000000000000000 AG 0 0 8 - \[ 7\] \.gnu\.linkonce\.ia6 IA_64_UNWIND 0000000000000000 00000070 + \[ 7\] \.gnu\.linkonce\.ia6 IA_64_UNWIND 0000000000000000 [0-9a-f]+ 0000000000000018 0000000000000000 ALG 5 5 8 \[ 8\] \.rela\.gnu\.linkonc RELA 0000000000000000 .* 0000000000000048 0000000000000018 IG 9 7 8 diff --git a/gas/testsuite/gas/mmix/bspec-2.d b/gas/testsuite/gas/mmix/bspec-2.d index 2ade9b6..02ec049 100644 --- a/gas/testsuite/gas/mmix/bspec-2.d +++ b/gas/testsuite/gas/mmix/bspec-2.d @@ -1,11 +1,11 @@ #readelf: -Sr -T -x1 -x4 There are 11 section headers, starting at offset .*: #... - \[ 4\] \.MMIX\.spec_data\.2 PROGBITS 0+ 0+48 + \[ 4\] \.MMIX\.spec_data\.2 PROGBITS 0+ [0-9a-f]+ 0+10 0+ 0 0 8 \[ 5\] \.rela\.MMIX\.spec_d RELA 0+ .* +0+30 0+18 +I +8 +4 +8 - \[ 6\] \.MMIX\.spec_data\.3 PROGBITS 0+ 0+58 + \[ 6\] \.MMIX\.spec_data\.3 PROGBITS 0+ [0-9a-f]+ 0+8 0+ 0 0 8 \[ 7\] \.rela\.MMIX\.spec_d RELA 0+ .* +0+18 +0+18 +I +8 +6 +8 -- cgit v1.1