Project

General

Profile

Actions

Bug #8917

open

ld could support C-style comments in map files

Added by Igor Kozhukhov over 4 years ago. Updated over 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2017-12-11
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

with ports of 3rd party userland apps we can see lib.map files with comments:

/*
 * comment1
 * comment2
 */

GNU LD works as well with comments, but illumos ld failed.

example:

root@z165:/rws1/users/root/du2/components/6# cat t1.c

int stub1(void)
{
        return 0;
}

root@z165:/rws1/users/root/du2/components/6# cat t1.map
/*
 * one line
 * two line
 */

VER_1 {
        local:
                *;
};

root@z165:/rws1/users/root/du2/components/6# gcc -fPIC -o t1.o -c t1.c

root@z165:/rws1/users/root/du2/components/6# gcc -shared -h t1.so.1 -o t1.so.1 -Wl,-M,t1.map t1.o
ld: fatal: t1.map: 2: expected a '=', ':', '|', or '@'
collect2: error: ld returned 1 exit status

root@z165:/rws1/users/root/du2/components/6# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/gcc/6/lib/gcc/x86_64-pc-solaris2.11/6.4.0/lto-wrapper
Target: x86_64-pc-solaris2.11
Configured with: ../configure --prefix=/usr/gcc/6 --build=x86_64-pc-solaris2.11 --bindir=/usr/gcc/6/bin --sbindir=/usr/gcc/6/sbin --libdir=/usr/gcc/6/lib --libexecdir=/usr/gcc/6/lib --infodir=/usr/gcc/6/share/info --mandir=/usr/gcc/6/share/man --target=x86_64-pc-solaris2.11 --enable-targets=i386-pc-solaris2.11 --enable-shared --enable-plugins --enable-lto --enable-initfini-array --enable-tls --enable-threads=posix --without-gnu-ld --with-ld=/usr/bin/ld --with-gnu-as --with-as=/usr/bin/gas --enable-languages=c,c++,fortran,go,lto,objc --with-system-zlib gcc_cv_ld_as_needed=no --disable-bootstrap
Thread model: posix
gcc version 6.4.0 (GCC)

root@z165:/rws1/users/root/du2/components/6# ld -V
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.1756 (illumos)

Actions #1

Updated by Igor Kozhukhov over 3 years ago

  • Description updated (diff)
Actions #2

Updated by Igor Kozhukhov over 3 years ago

  • Description updated (diff)
Actions #3

Updated by Igor Kozhukhov over 3 years ago

  • Subject changed from illumos ld do not work with comments like /* */ in map files to illumos ld do not work with comments like /* .. */ in multiple lines in map files
  • Description updated (diff)
Actions #4

Updated by Igor Kozhukhov over 3 years ago

  • Description updated (diff)
Actions #5

Updated by Joshua M. Clulow over 3 years ago

  • Subject changed from illumos ld do not work with comments like /* .. */ in multiple lines in map files to ld could support C-style comments in map files
Actions

Also available in: Atom PDF