https://sourceware.org/bugzilla/show_bug.cgi?id=30756
Bug ID: 30756 Summary: ld: -Wl,-z,pack-relative-relocs goes OOM on i586 link Product: binutils Version: 2.40 Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: amajer at suse dot de Target Milestone: --- while building Firefox for i686 (x86_64 kernel), the process runs out of memory after trying to allocate more than 4GB. The commandline is below. If I remove -Wl,-z,pack-relative-relocs option from the command line, the link succeeds and uses about 1GB of memory. /var/lib/build/ccache/bin/g++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-sized-deallocation -fno-aligned-new -fomit-frame-pointer -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -Os -march=i686 -mtune=generic -msse2 -g0 -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -freorder-blocks -O2 -fomit-frame-pointer -funwind-tables -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so /home/abuild/rpmbuild/BUILD/obj/toolkit/library/build/libxul_so.list -lpthread -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,--no-map-whole-files -Wl,--hash-size=31 -fPIC -Wl,-z,relro,-z,now -Wl,-z,pack-relative-relocs -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--build-id=sha1 -fstack-protector-strong -Wl,-rpath-link,/home/abuild/rpmbuild/BUILD/obj/dist/bin -Wl,-rpath-link,/usr/lib ../../../js/src/build/libjs_static.a /home/abuild/rpmbuild/BUILD/obj/i686-unknown-linux-gnu/release/libgkrust.a ../../../security/sandbox/linux/libmozsandbox.so ../../../config/external/lgpllibs/liblgpllibs.so ../../../config/external/sqlite/libmozsqlite3.so ../../../widget/gtk/mozgtk/libmozgtk.so ../../../widget/gtk/mozwayland/libmozwayland.so -Wl,--version-script,libxul.so.symbols -lasound -lrt -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrandr -lXrender -lXtst -lpthread -ldl -lc -lplds4 -lplc4 -lnspr4 -lz -lm -lssl3 -lsmime3 -lnss3 -lnssutil3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -ldbus-glib-1 -ldbus-1 -lxcb-shm -lX11-xcb -lxcb -lXcursor -lXi -lproxy I've reduced the error to "only" the following without external libraries. In the case the successful link produces a long list of missing symbols but with -Wl,-z,pack-relative-relocs, it's out of memory /bin/g++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-sized-deallocation -fno-aligned-new -fomit-frame-pointer -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -Os -march=i686 -mtune=generic -msse2 -g0 -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -freorder-blocks -O2 -fomit-frame-pointer -funwind-tables -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so b/* -Wl,--no-keep-memory -Wl,--reduce-memory-overheads -Wl,--no-map-whole-files -Wl,--hash-size=31 -fPIC -Wl,-z,relro,-z,now -Wl,-z,pack-relative-relocs -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--build-id=sha1 -fstack-protector-strong -Wl,-rpath-link,/home/abuild/rpmbuild/BUILD/obj/dist/bin -Wl,-rpath-link,/usr/lib t/libjs_static.a t/libgkrust.a t/libmozsandbox.so t/liblgpllibs.so t/libmozsqlite3.so t/libmozgtk.so t/libmozwayland.so /usr/lib/gcc/i586-suse-linux/13/../../../../i586-suse-linux/bin/ld: can't relax section: memory exhausted -- You are receiving this mail because: You are on the CC list for the bug.