Bug 468017
Summary: | output from objcopy is too large (2 GB) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dan Horák <dan> | ||||||||
Component: | binutils | Assignee: | Nick Clifton <nickc> | ||||||||
Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | rawhide | CC: | bhinson, jakub, jan.kratochvil, nickc | ||||||||
Target Milestone: | --- | ||||||||||
Target Release: | --- | ||||||||||
Hardware: | s390x | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2008-10-29 12:02:58 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | |||||||||||
Bug Blocks: | 467765 | ||||||||||
Attachments: |
|
Description
Dan Horák
2008-10-22 12:58:57 UTC
Created attachment 321142 [details]
using RHEL5 gcc + binutils
Created attachment 321143 [details]
using Fedora 9 gcc + binutils
Created attachment 321144 [details]
using Fedora 9 gcc + recent binutils built from upstream sources
Hi Dan, This is happening because of a "feature" in the linker. An extra section is being added to the executable file, and the presence of this section (starting at address 0x800000e8) is causing the conversion to the binary format to grow to the 2Gb size you noted. Run "objdump -h fba0.exec" to see this section: fba0.exec: file format elf64-s390 Sections: Idx Name Size VMA LMA File off Algn 0 .text 000000e8 0000000000000000 0000000000000000 00001000 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .note.gnu.build-id 00000024 00000000800000e8 00000000800000e8 000010e8 2**2 CONTENTS, ALLOC, LOAD, READONLY, DATA The presence of this section is not the linker's fault though. It is being requested by gcc. If you add the "-v" option to the command line in step 1 of your "Steps to Reproduce" you will see lots of output including an invocation of the collect2 program (a wrapper around the linker) in which the "--build-id" option is present. It is this option which is responsible for the creation of the .note.gnu.build-id section. To prevent this section from being created, and so restore normal sized binaries, add --build-id=none to the linker command line. Ie step 1 should read: 1. gcc -O2 -o fba0.exec -nostdlib -Wl,-Ttext,0 fba0.o -Wl,--build-id=none I hope that this helps. Cheers Nick Clifton Thanks for the explanation, Nick. I have just found another method - process only the .text section with objcopy objcopy -O binary -j .text fba0.exec fba0.bin |