summaryrefslogtreecommitdiff
path: root/output
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2019-09-12 17:45:11 -0700
committerH. Peter Anvin <hpa@zytor.com>2019-09-12 17:45:11 -0700
commite47f4b7ad5e9ee416cdcac72c04d84077af0d80f (patch)
treed00ed0a6f4c15cf33635a7671e0856ef4b0b87f1 /output
parent7ad25b2e1828a4569812f3296473f7a3bc7cd941 (diff)
downloadnasm-e47f4b7ad5e9ee416cdcac72c04d84077af0d80f.tar.gz
elf: fix "object" symbol keyword
The "object" symbol keyword would incorrectly generate STT_NOTYPE instead of STT_OBJECT. Add test for weak object references; they are different from plain weak references in that they are guaranteed to resolve to zero if the symbol is not found. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'output')
-rw-r--r--output/outelf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/output/outelf.c b/output/outelf.c
index 0c889bb6..787a3aab 100644
--- a/output/outelf.c
+++ b/output/outelf.c
@@ -872,7 +872,7 @@ static void elf_deflabel(char *name, int32_t segment, int64_t offset,
if (!nasm_strnicmp(spcword, "notype", wlen))
type = STT_NOTYPE;
else if (!nasm_strnicmp(spcword, "object", wlen))
- type = STT_NOTYPE;
+ type = STT_OBJECT;
else if (!nasm_strnicmp(spcword, "hidden", wlen))
sym->other = STV_HIDDEN;
else if (!nasm_strnicmp(spcword, "strong", wlen))