Skip to content

Commit df2f187

Browse files
committed
0.16
1 parent 407bb43 commit df2f187

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+308
-513
lines changed

amigahunks.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2015 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2015 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

aout.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2010 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2010 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168
#include "stabdefs.h"

aoutmint.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2010 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2010 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168
#include "tosdefs.h"

ar.c

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2010 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2010 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

ar.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2010 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2010 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

config.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2017 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2017 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168
#ifndef CONFIG_H

dir.c

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2011 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2011 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

elf.c

+11-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
/* $VER: vlink elf.c V0.15d (19.01.17)
1+
/* $VER: vlink elf.c V0.15e (23.03.17)
22
*
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2017 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2017 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

@@ -120,12 +112,16 @@ int elf_identify(struct FFFuncs *ff,char *name,void *p,
120112
case ET_REL:
121113
return arflag ? ID_LIBARCH : ID_OBJECT;
122114
case ET_EXEC:
123-
if (arflag) /* no executables in library archives */
115+
if (arflag) { /* no executables in library archives */
124116
error(40,name,ff->tname);
117+
return ID_UNKNOWN;
118+
}
125119
return ID_EXECUTABLE;
126120
case ET_DYN:
127-
if (arflag) /* no shared objects in library archives */
121+
if (arflag) { /* no shared objects in library archives */
128122
error(39,name,ff->tname);
123+
return ID_UNKNOWN;
124+
}
129125
return ID_SHAREDOBJ;
130126
default:
131127
error(41,name,ff->tname); /* illegal fmt. / file corrupted */
@@ -138,13 +134,14 @@ int elf_identify(struct FFFuncs *ff,char *name,void *p,
138134
}
139135

140136

141-
void elf_check_ar_type(struct FFFuncs *ff,const char *name,void *p,
137+
bool elf_check_ar_type(struct FFFuncs *ff,const char *name,void *p,
142138
unsigned char class,unsigned char endian,
143139
uint32_t ver,int nmach,...)
144140
/* check all library archive members before conversion */
145141
{
146142
struct Elf_CommonHdr *ehdr = (struct Elf_CommonHdr *)p;
147143
bool be = (endian == ELFDATA2MSB);
144+
bool valid = TRUE;
148145
uint16_t m = read16(be,ehdr->e_machine);
149146
va_list vl;
150147

@@ -174,10 +171,11 @@ void elf_check_ar_type(struct FFFuncs *ff,const char *name,void *p,
174171
}
175172
}
176173
}
177-
error(41,name,ff->tname);
174+
valid = FALSE;
178175

179176
check_ar_exit:
180177
va_end(vl);
178+
return valid;
181179
}
182180

183181

elf32.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2011 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2011 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

elf32std.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2011 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2011 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

elf64.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2011 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2011 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

elf64std.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2011 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2011 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

elfcommon.h

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
/* $VER: vlink elfcommon.h V0.15a (22.01.15)
1+
/* $VER: vlink elfcommon.h V0.15e (23.03.17)
22
*
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
5-
* Copyright (c) 1997-2015 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2015 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
5+
* Copyright (c) 1997-2017 Frank Wille
146
*/
157

168

@@ -359,7 +351,7 @@ extern const char *pltrel_name[2];
359351
/* functions for reading */
360352
int elf_identify(struct FFFuncs *,char *,void *,lword,unsigned char,
361353
unsigned char,uint16_t,uint32_t);
362-
void elf_check_ar_type(struct FFFuncs *,const char *,void *,unsigned char,
354+
bool elf_check_ar_type(struct FFFuncs *,const char *,void *,unsigned char,
363355
unsigned char,uint32_t,int,...);
364356
void elf_check_offset(struct LinkFile *,char *,void *,lword);
365357
struct Section *elf_add_section(struct GlobalVars *,struct ObjectUnit *,

errors.c

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
/* $VER: vlink errors.c V0.15d (02.01.17)
1+
/* $VER: vlink errors.c V0.15e (23.03.17)
22
*
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2017 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2017 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

@@ -77,8 +69,8 @@ static struct {
7769
"%s=0x%llx + 0x%llx (value to write: 0x%llx) doesn't fit into %d bits",EF_ERROR,
7870
"%s: Malformatted archive member %s",EF_FATAL,
7971
"%s: Empty archive ignored",EF_WARNING,
80-
"%s: %s doesn't support shared objects in library archives",EF_FATAL,
81-
"%s: %s doesn't support executables in library archives",EF_FATAL,/* 40 */
72+
"%s: %s doesn't support shared objects in library archives",EF_WARNING,
73+
"%s: %s doesn't support executables in library archives",EF_WARNING,/* 40 */
8274
"%s (%s): Illegal format / file corrupted",EF_FATAL,
8375
"%s: Consistency check for archive member %s failed",EF_FATAL,
8476
"%s: Invalid ELF section header index (%d) in %s",EF_FATAL,
@@ -196,6 +188,9 @@ static struct {
196188
"Need a valid symbolic entry when using -gc-all",EF_FATAL,
197189
"Executable code section in first object required when using -gc-all",
198190
EF_FATAL,
191+
"Unsupported absolute relocation (offs=%lld pos=%d siz=%d msk=0x%llx) "
192+
"in resident data section",EF_ERROR,
193+
"%s (%s+0x%x): Absolute reference to resident data section (%s)",EF_WARNING,
199194
};
200195

201196

expr.c

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2012 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2012 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

history

+16
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ vlink history
1414
(tos): changes for the Atari TOS format
1515

1616

17+
- 0.16 (16.05.17)
18+
o Fixed a potential crash when linking with empty object files, while
19+
using a linker script.
20+
o (ados/ehf): Support blink/slink linker symbols _RESLEN, _RESBASE,
21+
_NEWDATAL for generating resident (pure) programs.
22+
o (ados/ehf): Fixed SAS/C-compatibility linker symbol __BSSLEN. Now it
23+
represents the number of long words instead of the number of bytes.
24+
WARNING! Make sure to check your code, if you used __BSSLEN before!
25+
o (ados/ehf): AmigaOS LoadSeg() (up to V40) has a problem with allocating
26+
data-bss sections, which have an initialized size of 0. Implemented a
27+
workaround for this case.
28+
o (elf) Fixed crash in dynamic linking due to section-trimming.
29+
o (elf,aout) Malformatted library archive files are no longer fatal, but
30+
will be ignored.
31+
o (rawseg) Do not write output sections marked with NOLOAD.
32+
1733
- 0.15d (06.02.17)
1834
o Section-trimming, introduced with V0.15b, did not work well with ELF
1935
executables. Fixed that.

ldscript.c

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2013 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2013 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

ldscript.h

-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
* This file is part of vlink, a portable linker for multiple
44
* object formats.
55
* Copyright (c) 1997-2010 Frank Wille
6-
*
7-
* vlink is freeware and part of the portable and retargetable ANSI C
8-
* compiler vbcc, copyright (c) 1995-2010 by Volker Barthelmann.
9-
* vlink may be freely redistributed as long as no modifications are
10-
* made and nothing is charged for it. Non-commercial usage is allowed
11-
* without any restrictions.
12-
* EVERY PRODUCT OR PROGRAM DERIVED DIRECTLY FROM MY SOURCE MAY NOT BE
13-
* SOLD COMMERCIALLY WITHOUT PERMISSION FROM THE AUTHOR.
146
*/
157

168

0 commit comments

Comments
 (0)