mirror of
https://github.com/rui314/mold.git
synced 2024-09-11 13:06:59 +03:00
Report an error if a non-PIC object file is given for an PIC output
This commit is contained in:
parent
9fe3d750cc
commit
e06d886252
@ -1094,6 +1094,11 @@ void ObjectFile<E>::scan_relocations(Context<E> &ctx) {
|
||||
for (ElfRel<E> &rel : cie.get_rels()) {
|
||||
Symbol<E> &sym = *this->symbols[rel.r_sym];
|
||||
|
||||
if (ctx.arg.pic && rel.r_type == E::R_ABS)
|
||||
Error(ctx) << *this << ": relocation " << rel << " in .eh_frame can not"
|
||||
<< " be used when making a position-independent output;"
|
||||
<< " recompile with -fPIE or -fPIC";
|
||||
|
||||
if (sym.is_imported) {
|
||||
if (sym.get_type() != STT_FUNC)
|
||||
Fatal(ctx) << *this << ": " << sym
|
||||
|
Loading…
Reference in New Issue
Block a user