Skip to content

Always emit symbols like _GLOBAL_OFFSET_TABLE_, _PROCEDURE_LINKAGE_TABLE_ and others #308

Description

@marxin

I noticed these symbols are always emitted by the Mold linker and the presence of the symbols seems to me pretty hand when it comes to disassembly:

$ cat lib.c
void foo() {
  __builtin_printf("xxx\n");
}
$ gcc lib.c -fPIC -shared -o lib.so -fuse-ld=mold
$ readelf -sW lib.so
...
    67: 00000000000026f0     0 NOTYPE  LOCAL  DEFAULT   19 _DYNAMIC
    68: 00000000000028e8     0 NOTYPE  LOCAL  DEFAULT   21 _GLOBAL_OFFSET_TABLE_
    69: 00000000000015e0     0 NOTYPE  LOCAL  DEFAULT   16 _PROCEDURE_LINKAGE_TABLE_
...
    81: 0000000000000000     0 TLS     LOCAL  DEFAULT    1 _TLS_MODULE_BASE_

On the other hand, the Wild linker does not emit these symbols.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions