Skip to contentSkip to conversation

systemd: Explicitly add hidden attribute to __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP

PATCH In review Khem Raj 2 participants 2 messages Mar 3, 2018 – Mar 9, 2018

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 systemd: Explicitly add hidden attribute to __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP

These symbols appear in dynsyms of libsystemd.so and musl loader doesnt like it

Error relocating /mnt/a/oe/build/tmp/work/i586-bec-linux-musl/avahi/0.7-r0/recipe-sysroot//lib/libsystemd.so.0: __start_BUS_ERROR_MAP: symbol not found Error relocating /mnt/a/oe/build/tmp/work/i586-bec-linux-musl/avahi/0.7-r0/recipe-sysroot//lib/libsystemd.so.0: __stop_BUS_ERROR_MAP: symbol not found

[YOCTO #12577]

---
 ...rt_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch | 34 ++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_234.bb           |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch new file +34 -0
new file mode 100644
index 0000000000..2cffc426ed
@@ -0,0 +1,34 @@
+From 687a5af8dc5d38f918a6ce08fed5297234bf8346 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 2 Mar 2018 18:00:17 -0800
+Subject: [PATCH] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
+
+for currently unknown reasons they get exported to the shared libries
+even without being listed in the sym file
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+
+Upstream-Status: Pending [ Conditional on master needing this, 234 does need it ]
+
+ src/libsystemd/sd-bus/bus-error.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
+index 378f7a377..49d797abd 100644
+--- a/src/libsystemd/sd-bus/bus-error.c
++++ b/src/libsystemd/sd-bus/bus-error.c
+@@ -71,8 +71,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
+ };
+ 
+ /* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */
+-extern const sd_bus_error_map __start_BUS_ERROR_MAP[];
+-extern const sd_bus_error_map __stop_BUS_ERROR_MAP[];
++extern const sd_bus_error_map __start_BUS_ERROR_MAP[] _hidden_;
++extern const sd_bus_error_map __stop_BUS_ERROR_MAP[] _hidden_;
+ 
+ /* Additional maps registered with sd_bus_error_add_map() are in this
+  * NULL terminated array */
+-- 
+2.16.2
+
meta/recipes-core/systemd/systemd_234.bb +1 -0
index d12e94f463..b15e5a41db 100644
@@ -51,6 +51,7 @@ SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \
            file://0001-meson-update-header-file-to-detect-memfd_create.patch \
            file://0002-configure.ac-Check-if-memfd_create-is-already-define.patch \
            file://0003-fileio-include-sys-mman.h.patch \
+           file://0001-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
            "
 SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
 
Signature · 1 line
2.16.2
#1 lore raw

I see this, too.

BTW, some more info:

This looks similar to
https://github.com/systemd/systemd/issues/234
and was worked-around in systemd commit aac7c5ed8bc6 ("build-sys: hide magic section variables from exported symbols") until reverted in commit 780950a2ba58 ("Revert "build-sys: hide magic section variables from exported symbols"") because binutils was fixed since.
This error should only ever happen with old versions of ld.gold. In addition, gold should be fixed by now:

    https://sourceware.org/bugzilla/show_bug.cgi?id=18548
    https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5417c94d1a944d1a27f99240e5d62a6d7cd324f1

but something is amiss here.

ld -v gives
GNU ld (GNU Binutils) 2.30.0.20180208

so this is a bit strange...

Cheers,
Andre'

Quoted 90 lines · Khem Raj

These symbols appear in dynsyms of libsystemd.so and musl loader doesnt like it

Error relocating /mnt/a/oe/build/tmp/work/i586-bec-linux-musl/avahi/0.7- r0/recipe-sysroot//lib/libsystemd.so.0: __start_BUS_ERROR_MAP: symbol not found
Error relocating /mnt/a/oe/build/tmp/work/i586-bec-linux-musl/avahi/0.7- r0/recipe-sysroot//lib/libsystemd.so.0: __stop_BUS_ERROR_MAP: symbol not found

[YOCTO #12577]

---
 ...rt_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch | 34
++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_234.bb           |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0001-Hide-

__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch

(quoted diff) +0 -0

__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch b/meta/recipes- core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP-and- __stop_BUS_ERROR_MAP.patch
new file mode 100644
index 0000000000..2cffc426ed

meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP- new file +0 -0

and-__stop_BUS_ERROR_MAP.patch

meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP- new file +12 -0
@@ -0,0 +1,34 @@
+From 687a5af8dc5d38f918a6ce08fed5297234bf8346 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 2 Mar 2018 18:00:17 -0800
+Subject: [PATCH] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
+
+for currently unknown reasons they get exported to the shared libries
+even without being listed in the sym file
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+
+Upstream-Status: Pending [ Conditional on master needing this, 234 does

need it ]

meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP- new file +5 -0
+
+ src/libsystemd/sd-bus/bus-error.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-

bus/bus-error.c
+index 378f7a377..49d797abd 100644
+--- a/src/libsystemd/sd-bus/bus-error.c
++++ b/src/libsystemd/sd-bus/bus-error.c
+@@ -71,8 +71,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
+ };
+
+ /* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */

+-extern const sd_bus_error_map __start_BUS_ERROR_MAP[];
+-extern const sd_bus_error_map __stop_BUS_ERROR_MAP[];

++extern const sd_bus_error_map __start_BUS_ERROR_MAP[] _hidden_; ++extern const sd_bus_error_map __stop_BUS_ERROR_MAP[] _hidden_; +
+ /* Additional maps registered with sd_bus_error_add_map() are in this

meta/recipes-core/systemd/systemd/0001-Hide-__start_BUS_ERROR_MAP- new file +4 -0
+  * NULL terminated array */
+-- 
+2.16.2
+
meta/recipes- renamed from meta/recipes-core/systemd/systemd_234.bb +0 -0

core/systemd/systemd_234.bb
index d12e94f463..b15e5a41db 100644

meta/recipes-core/systemd/systemd_234.bb +1 -0
@@ -51,6 +51,7 @@ SRC_URI =
 "git://github.com/systemd/systemd.git;protocol=git \
            file://0001-meson-update-header-file-to-detect-
 memfd_create.patch \
            file://0002-configure.ac-Check-if-memfd_create-is-already-
 define.patch \
            file://0003-fileio-include-sys-mman.h.patch \
+           file://0001-Hide-__start_BUS_ERROR_MAP-and-
__stop_BUS_ERROR_MAP.patch \
            "

SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-
device-timeout-to-2.patch"

Signature · 1 line
2.16.2