[systemd-devel] Build error with 218 - undefined reference to `__start_BUS_ERROR_MAP'

Umut Tezduyar Lindskog umut at tezduyar.com
Fri Dec 12 01:10:15 PST 2014


On Fri, Dec 12, 2014 at 12:24 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> On Thu, 11.12.14 23:01, Umut Tezduyar Lindskog (umut at tezduyar.com) wrote:
>
>> Trying to build 218 but I am getting undefined reference error. The
>> source code of bus-error.c mentions that gcc magically maps these
>> variables but not for me.
>>
>> What is doing the mapping? __attribute__ ((__section__("BUS_ERROR_MAP"))) ?
>>
>> Could it be that mentioned "gcc magic" is not supported on cross compiling?
>>
>> Also, why do we need to use elf section instead of iterating over
>> bus_standard_errors[]?
>
> The idea is that any .c file linked into a binary can define
> additional maps, and we collect them all simply by iterating through
> __start_BUS_ERROR_MAP to __stop_BUS_ERROR_MAP.
>
> The __start_XYZ/__stop_XYZ magic is pretty old ld/gold stuff, support
> since a long time.
>
> Is there something fishy with your toolchain? Any particular build
> time options you turned on or off? Some really old ld
> versions would end up dropping these sections a bit too eagerly:

Maybe. I will ask this internally too.

>
> https://sourceware.org/bugzilla/show_bug.cgi?id=11133
>
> But that's 4y old... Or is your toolchain that old?

Shouldn't be:

mipsisa32r2el-axis-linux-gnu-gcc --version
mipsisa32r2el-axis-linux-gnu-gcc (GCC 4.7.2 Axis release R24/1.24)
4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527]


>
>>   CCLD     libnss_resolve.la
>> libsystemd_shared_la-hashmap.o (symbol from plugin): warning: memset
>> used with constant zero length parameter; this could be due to
>> transposed parameters
>> /tmp/ccHr0vVt.ltrans13.ltrans.o: In function `bus_error_name_to_errno.14134':
>> ccHr0vVt.ltrans13.o:(.text+0x7b0): undefined reference to
>> `__start_BUS_ERROR_MAP'
>> ccHr0vVt.ltrans13.o:(.text+0x7b4): undefined reference to `__stop_BUS_ERROR_MAP'
>> collect2: error: ld returned 1 exit status
>>
>> Umut
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
> Lennart
>
> --
> Lennart Poettering, Red Hat


More information about the systemd-devel mailing list