mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-27 08:10:07 +08:00
ELF: Explicitly point out SYM_GLOBAL, SYM_LOCAL binding
Instead of implicit declaration of global symbols obtained by STB_GLOBAL << 4, and local symbols by STB_LOCAL << 4 use ELF32_ST_MKBIND helpers. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
de623f2679
commit
a135658e83
@ -37,7 +37,11 @@
|
||||
#ifndef OUTPUT_OUTELF_H
|
||||
#define OUTPUT_OUTELF_H
|
||||
|
||||
#define SYM_GLOBAL 0x10
|
||||
#include "output/elf.h"
|
||||
|
||||
/* symbol binding */
|
||||
#define SYM_GLOBAL ELF32_ST_MKBIND(STB_GLOBAL)
|
||||
#define SYM_LOCAL ELF32_ST_MKBIND(STB_LOCAL)
|
||||
|
||||
#define GLOBAL_TEMP_BASE 0x40000000 /* bigger than any sane symbol index */
|
||||
|
||||
|
@ -56,7 +56,6 @@
|
||||
|
||||
#include "output/dwarf.h"
|
||||
#include "output/stabs.h"
|
||||
#include "output/elf.h"
|
||||
#include "output/outelf.h"
|
||||
|
||||
#ifdef OF_ELF32
|
||||
@ -516,7 +515,7 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset,
|
||||
memset(&sym->symv, 0, sizeof(struct rbtree));
|
||||
|
||||
sym->strpos = pos;
|
||||
sym->type = is_global ? SYM_GLOBAL : 0;
|
||||
sym->type = is_global ? SYM_GLOBAL : SYM_LOCAL;
|
||||
sym->other = STV_DEFAULT;
|
||||
sym->size = 0;
|
||||
if (segment == NO_SEG)
|
||||
|
@ -56,7 +56,6 @@
|
||||
|
||||
#include "output/dwarf.h"
|
||||
#include "output/stabs.h"
|
||||
#include "output/elf.h"
|
||||
#include "output/outelf.h"
|
||||
|
||||
#ifdef OF_ELF64
|
||||
@ -514,7 +513,7 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset,
|
||||
memset(&sym->symv, 0, sizeof(struct rbtree));
|
||||
|
||||
sym->strpos = pos;
|
||||
sym->type = is_global ? SYM_GLOBAL : 0;
|
||||
sym->type = is_global ? SYM_GLOBAL : SYM_LOCAL;
|
||||
sym->other = STV_DEFAULT;
|
||||
sym->size = 0;
|
||||
if (segment == NO_SEG)
|
||||
|
Loading…
Reference in New Issue
Block a user