summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorJob Bautista <jobbautista9@protonmail.com>2023-01-05 13:12:29 +0800
committerJob Bautista <jobbautista9@protonmail.com>2023-01-05 13:12:29 +0800
commit2e8442e6ec42ad8027fbf3111b3eb3d8f775cf09 (patch)
tree0d23d06693a6bda578516c65c35f2c4779f2b319 /toolkit
parent61b688198ab481187830e9b3eb2e1b8d9afdec14 (diff)
downloaduxp-2e8442e6ec42ad8027fbf3111b3eb3d8f775cf09.tar.gz
Issue #2079 - Fix linking libxul on *nix when using a linker other than bfd.
Don't mark the .kPStaticModules section as relro for bfd, as the linkers on Windows and Mac don't do this anyway. Add a section insert of .kPStaticModules to config/expandlibs_exec.py, which seems to be the primary cause of linking bustage on gold, lld, and mold.
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/library/StaticXULComponents.ld5
-rw-r--r--toolkit/library/libxul.mk15
2 files changed, 0 insertions, 20 deletions
diff --git a/toolkit/library/StaticXULComponents.ld b/toolkit/library/StaticXULComponents.ld
deleted file mode 100644
index e4fe728134..0000000000
--- a/toolkit/library/StaticXULComponents.ld
+++ /dev/null
@@ -1,5 +0,0 @@
-SECTIONS {
- .data.rel.ro : {
- *(.kPStaticModules)
- }
-}
diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk
index d09a3962fd..7b18c1f7e5 100644
--- a/toolkit/library/libxul.mk
+++ b/toolkit/library/libxul.mk
@@ -29,21 +29,6 @@ ifeq ($(OS_ARCH),SunOS)
OS_LDFLAGS += -Wl,-z,defs
endif
-# BFD ld doesn't create multiple PT_LOADs as usual when an unknown section
-# exists. Using an implicit linker script to make it fold that section in
-# .data.rel.ro makes it create multiple PT_LOADs. That implicit linker
-# script however makes gold misbehave, first because it doesn't like that
-# the linker script is given after crtbegin.o, and even past that, replaces
-# the default section rules with those from the script instead of
-# supplementing them. Which leads to a lib with a huge load of sections.
-ifneq (OpenBSD,$(OS_TARGET))
-ifneq (WINNT,$(OS_TARGET))
-ifdef LD_IS_BFD
-OS_LDFLAGS += $(topsrcdir)/toolkit/library/StaticXULComponents.ld
-endif
-endif
-endif
-
ifdef _MSC_VER
get_first_and_last = dumpbin -exports $1 | grep _NSModule@@ | sort -k 3 | sed -n 's/^.*?\([^@]*\)@@.*$$/\1/;1p;$$p'
else