1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-27 10:23:41 +03:00
This commit is contained in:
Rui Ueyama 2021-04-11 20:55:05 +09:00
parent 09fc73a9f8
commit bcabda7827
2 changed files with 14 additions and 14 deletions

View File

@ -6,19 +6,6 @@
#include <tbb/parallel_for_each.h>
#include <tbb/parallel_sort.h>
template <typename E>
i64 BuildId::size(Context<E> &ctx) const {
switch (kind) {
case HEX:
return value.size();
case HASH:
return hash_size;
case UUID:
return 16;
}
unreachable(ctx);
}
template <typename E>
void OutputEhdr<E>::copy_buf(Context<E> &ctx) {
ElfEhdr<E> &hdr = *(ElfEhdr<E> *)(ctx.buf + this->shdr.sh_offset);
@ -1377,6 +1364,19 @@ void VerdefSection<E>::copy_buf(Context<E> &ctx) {
write_vector(ctx.buf + this->shdr.sh_offset, contents);
}
template <typename E>
i64 BuildId::size(Context<E> &ctx) const {
switch (kind) {
case HEX:
return value.size();
case HASH:
return hash_size;
case UUID:
return 16;
}
unreachable(ctx);
}
template <typename E>
void BuildIdSection<E>::update_shdr(Context<E> &ctx) {
this->shdr.sh_size = HEADER_SIZE + ctx.arg.build_id.size(ctx);

View File

@ -779,7 +779,7 @@ i64 get_section_rank(Context<E> &ctx, OutputChunk<E> *chunk) {
bool hasbits = !(type == SHT_NOBITS);
return ((!reaodnly << 9) | (exec << 8) | (!tls << 7) |
(!relro << 6) | (!hasbits << 5)) + 4;
(!relro << 6) | (!hasbits << 5)) + (1 << 4);
}
// Returns the smallest number n such that